summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-10-22 17:20:10 +0200
committerJaroslav Kysela <perex@perex.cz>2007-10-23 08:07:55 +0200
commit41923e441305728ba3640e773e55d16e4769145c (patch)
treeeeaad57d30237f5f26851f8f72a24485177ba077 /sound/pci/hda/hda_local.h
parent7507e8da2f21476007501f04d8bce2b7d0cb3971 (diff)
downloadblackbird-op-linux-41923e441305728ba3640e773e55d16e4769145c.tar.gz
blackbird-op-linux-41923e441305728ba3640e773e55d16e4769145c.zip
[ALSA] hda-codec - Fix possible array overflow
dac_nids arrays in each codec support code may have up to 5 items when assigned from the auto-configurator. Some codec codes have less numbers than the possible max. This patch defines the constant and fixes the array definitions. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index a708effdcdad..20c5e6250374 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -310,16 +310,17 @@ enum {
extern const char *auto_pin_cfg_labels[AUTO_PIN_LAST];
+#define AUTO_CFG_MAX_OUTS 5
+
struct auto_pin_cfg {
int line_outs;
- hda_nid_t line_out_pins[5]; /* sorted in the order of
- * Front/Surr/CLFE/Side
- */
+ /* sorted in the order of Front/Surr/CLFE/Side */
+ hda_nid_t line_out_pins[AUTO_CFG_MAX_OUTS];
int speaker_outs;
- hda_nid_t speaker_pins[5];
+ hda_nid_t speaker_pins[AUTO_CFG_MAX_OUTS];
int hp_outs;
int line_out_type; /* AUTO_PIN_XXX_OUT */
- hda_nid_t hp_pins[5];
+ hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS];
hda_nid_t input_pins[AUTO_PIN_LAST];
hda_nid_t dig_out_pin;
hda_nid_t dig_in_pin;
OpenPOWER on IntegriCloud