diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-10-28 11:39:23 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-10-29 11:37:19 +0100 |
commit | 728deecdd4e9b4a58faf518638169c743c57cee2 (patch) | |
tree | 52d2e7066f146a4e642c4b15fadeae3fc728295f /sound/pci | |
parent | 9b389a8a022110b4bc055a19b888283544d9eba6 (diff) | |
download | op-kernel-dev-728deecdd4e9b4a58faf518638169c743c57cee2.zip op-kernel-dev-728deecdd4e9b4a58faf518638169c743c57cee2.tar.gz |
ALSA: hda - Fix possible NULL dereference in snd_hda_get_pin_label()
Fix a possible NULL access of indexp in fill_audio_out_name() called
from snd_hda_get_pin_label().
Spotted by coverity CID 402035.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_auto_parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index 48a9d00..853c6a6 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c @@ -638,7 +638,7 @@ static int fill_audio_out_name(struct hda_codec *codec, hda_nid_t nid, /* don't add channel suffix for Headphone controls */ int idx = get_hp_label_index(codec, nid, cfg->hp_pins, cfg->hp_outs); - if (idx >= 0) + if (idx >= 0 && indexp) *indexp = idx; sfx = ""; } |