mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 08:40:53 +07:00
ALSA: hda/realtek - Fix Oops in alc_mux_select()
When no imux is available (e.g. a single capture source), alc_auto_init_input_src() may trigger an Oops due to the access to -1. Add a proper zero-check to avoid it. Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
fc084e0b93
commit
cce4aa378a
@ -297,6 +297,8 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
|
||||
imux = &spec->input_mux[mux_idx];
|
||||
if (!imux->num_items && mux_idx > 0)
|
||||
imux = &spec->input_mux[0];
|
||||
if (!imux->num_items)
|
||||
return 0;
|
||||
|
||||
if (idx >= imux->num_items)
|
||||
idx = imux->num_items - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user