projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa558c2
)
ASoC: simple-card: Add cpu_dai and codec_dai names NULL check
author
Xiubo Li
<Li.Xiubo@freescale.com>
Fri, 20 Dec 2013 06:39:50 +0000
(14:39 +0800)
committer
Mark Brown
<broonie@linaro.org>
Sat, 21 Dec 2013 14:42:48 +0000
(14:42 +0000)
The name of cpu DAI maybe omitted, and then strlen() will lead
kernel panic.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/generic/simple-card.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/soc/generic/simple-card.c
b/sound/soc/generic/simple-card.c
index 7a9b6b4898c02dde4dcca9669bfb6ff93e226651..be7c1db5388faddcb4f6477b345ed5efba4abc9e 100644
(file)
--- a/
sound/soc/generic/simple-card.c
+++ b/
sound/soc/generic/simple-card.c
@@
-142,6
+142,9
@@
static int asoc_simple_card_parse_of(struct device_node *node,
if (ret < 0)
return ret;
+ if (!info->cpu_dai.name || !info->codec_dai.name)
+ return -EINVAL;
+
/* card name is created from CPU/CODEC dai name */
name = devm_kzalloc(dev,
strlen(info->cpu_dai.name) +