summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-22 09:56:54 +0300
committerMark Brown <broonie@linaro.org>2013-07-22 11:00:05 +0100
commitb5c745fb75b7e5ab06e9c99d63427595a234cc89 (patch)
treee8749833c16bb2e8d88be3a4cf16990cc2e26e99 /sound
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
downloadlinux-b5c745fb75b7e5ab06e9c99d63427595a234cc89.tar.gz
linux-b5c745fb75b7e5ab06e9c99d63427595a234cc89.tar.bz2
linux-b5c745fb75b7e5ab06e9c99d63427595a234cc89.zip
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 0ec070cf7231..d82ee386eab5 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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;