Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5803a326 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda/realtek - Fix possible Oops with NULL input_mux



When BIOS is damn crazy and gives no pin-config at all, the driver might
lead to a NULL dereference.  Let's add a NULL check for such a case.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 164f73ee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -302,6 +302,9 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
	int i, type, num_conns;
	hda_nid_t nid;

	if (!spec->input_mux)
		return 0;

	mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
	imux = &spec->input_mux[mux_idx];
	if (!imux->num_items && mux_idx > 0)