mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-12 04:19:08 +00:00
ALSA: hda - Fix NULL dereference in kctl-NID mapping in patch_realtek.c
capsrc_nids can be NULL, and adc_nids should be taken as fallback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9e671deb85
commit
d1409ae4ce
@ -2517,7 +2517,10 @@ static int alc_build_controls(struct hda_codec *codec)
|
||||
if (!kctl)
|
||||
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
|
||||
for (i = 0; kctl && i < kctl->count; i++) {
|
||||
err = snd_hda_add_nids(codec, kctl, i, spec->capsrc_nids,
|
||||
hda_nid_t *nids = spec->capsrc_nids;
|
||||
if (!nids)
|
||||
nids = spec->adc_nids;
|
||||
err = snd_hda_add_nids(codec, kctl, i, nids,
|
||||
spec->input_mux->num_items);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user