aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-22 02:56:54 -0400
committerMark Brown <broonie@linaro.org>2013-07-22 06:00:05 -0400
commitb5c745fb75b7e5ab06e9c99d63427595a234cc89 (patch)
treee8749833c16bb2e8d88be3a4cf16990cc2e26e99 /sound/soc
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
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/soc')
-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,
3908{ 3908{
3909 /* create platform component name */ 3909 /* create platform component name */
3910 platform->name = fmt_single_name(dev, &platform->id); 3910 platform->name = fmt_single_name(dev, &platform->id);
3911 if (platform->name == NULL) { 3911 if (platform->name == NULL)
3912 kfree(platform);
3913 return -ENOMEM; 3912 return -ENOMEM;
3914 }
3915 3913
3916 platform->dev = dev; 3914 platform->dev = dev;
3917 platform->driver = platform_drv; 3915 platform->driver = platform_drv;