mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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>
This commit is contained in:
parent
9b389a8a02
commit
728deecdd4
@ -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 */
|
/* don't add channel suffix for Headphone controls */
|
||||||
int idx = get_hp_label_index(codec, nid, cfg->hp_pins,
|
int idx = get_hp_label_index(codec, nid, cfg->hp_pins,
|
||||||
cfg->hp_outs);
|
cfg->hp_outs);
|
||||||
if (idx >= 0)
|
if (idx >= 0 && indexp)
|
||||||
*indexp = idx;
|
*indexp = idx;
|
||||||
sfx = "";
|
sfx = "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user