提交 dd41e0c4 编写于 作者: X Xiubo Li 提交者: Mark Brown

ASoC: simple-card: Add cpu_dai and codec_dai names NULL check

The name of cpu DAI maybe omitted, and then strlen() will lead
kernel panic.
Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 fa558c28
......@@ -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) +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册