提交 b5c745fb 编写于 作者: D Dan Carpenter 提交者: Mark Brown

ASoC: core: double free in snd_soc_add_platform()

There are three callers for this function, and none of them want it to
free platform for them.  It leads to a double free.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 3b2f64d0
......@@ -3908,10 +3908,8 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
{
/* create platform component name */
platform->name = fmt_single_name(dev, &platform->id);
if (platform->name == NULL) {
kfree(platform);
if (platform->name == NULL)
return -ENOMEM;
}
platform->dev = dev;
platform->driver = platform_drv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册