projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
164f73e
)
ALSA: hda/realtek - Fix possible Oops with NULL input_mux
author
Takashi Iwai
<tiwai@suse.de>
Tue, 21 Feb 2012 10:59:45 +0000
(11:59 +0100)
committer
Takashi Iwai
<tiwai@suse.de>
Tue, 21 Feb 2012 10:59:45 +0000
(11:59 +0100)
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: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/pci/hda/patch_realtek.c
b/sound/pci/hda/patch_realtek.c
index eba50dff613047e1d8e7ef9ce7cfe4383b1b9c74..997cc8127a082b10e6eddf1fcbaf6d24ad7b422b 100644
(file)
--- a/
sound/pci/hda/patch_realtek.c
+++ b/
sound/pci/hda/patch_realtek.c
@@
-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)