20 Dec
2013
20 Dec
'13
7:39 a.m.
The name of cpu DAI maybe omitted, and then strlen() will lead kernel panic.
Signed-off-by: Xiubo Li Li.Xiubo@freescale.com --- sound/soc/generic/simple-card.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 3d190d0..1d87db8 100644 --- 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) +
--
1.8.4