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:
fc084e0
)
ALSA: hda/realtek - Fix Oops in alc_mux_select()
author
Takashi Iwai
<tiwai@suse.de>
Fri, 2 Dec 2011 14:29:12 +0000
(15:29 +0100)
committer
Takashi Iwai
<tiwai@suse.de>
Fri, 2 Dec 2011 14:29:12 +0000
(15:29 +0100)
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>
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 cbde019d3d52b985e4c8a95b5f74386ac34eef69..a7d1bc4e0d097a9020e39fe0d6b206e114575ec1 100644
(file)
--- a/
sound/pci/hda/patch_realtek.c
+++ b/
sound/pci/hda/patch_realtek.c
@@
-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;