Skip to content

Commit 72a8cf9

Browse files
tiwaigregkh
authored andcommitted
ALSA: hda/realtek - Fix Oops in alc_mux_select()
commit cce4aa3 upstream. 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. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 95d2c2c commit 72a8cf9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎sound/pci/hda/patch_realtek.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
280280
imux = &spec->input_mux[mux_idx];
281281
if (!imux->num_items && mux_idx > 0)
282282
imux = &spec->input_mux[0];
283+
if (!imux->num_items)
284+
return 0;
283285

284286
if (idx >= imux->num_items)
285287
idx = imux->num_items - 1;

0 commit comments

Comments
 (0)