git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls()
[sfrench/cifs-2.6.git]
/
sound
/
i2c
/
other
/
ak4xxx-adda.c
diff --git
a/sound/i2c/other/ak4xxx-adda.c
b/sound/i2c/other/ak4xxx-adda.c
index 5f59316f982aec71f89de6d1bc91f18f5e7d3c39..7d15093844b9232fc83ccfc16c1225ee00b43168 100644
(file)
--- a/
sound/i2c/other/ak4xxx-adda.c
+++ b/
sound/i2c/other/ak4xxx-adda.c
@@
-775,11
+775,12
@@
static int build_adc_controls(struct snd_akm4xxx *ak)
return err;
memset(&knew, 0, sizeof(knew));
return err;
memset(&knew, 0, sizeof(knew));
- knew.name = ak->adc_info[mixer_ch].selector_name;
-
if (!knew.
name) {
+ if (!ak->adc_info ||
+
!ak->adc_info[mixer_ch].selector_
name) {
knew.name = "Capture Channel";
knew.index = mixer_ch + ak->idx_offset * 2;
knew.name = "Capture Channel";
knew.index = mixer_ch + ak->idx_offset * 2;
- }
+ } else
+ knew.name = ak->adc_info[mixer_ch].selector_name;
knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
knew.info = ak4xxx_capture_source_info;
knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
knew.info = ak4xxx_capture_source_info;