diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-07-22 09:56:54 +0300 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-22 11:00:05 +0100 |
commit | b5c745fb75b7e5ab06e9c99d63427595a234cc89 (patch) | |
tree | e8749833c16bb2e8d88be3a4cf16990cc2e26e99 /sound/soc | |
parent | 3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff) | |
download | op-kernel-dev-b5c745fb75b7e5ab06e9c99d63427595a234cc89.zip op-kernel-dev-b5c745fb75b7e5ab06e9c99d63427595a234cc89.tar.gz |
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.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0ec070c..d82ee38 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; |