summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-12-08 14:05:43 +0100
committerMark Brown <broonie@kernel.org>2016-12-15 12:04:23 +0100
commit0ea617a298dcdc2251b4e10f83ac3f3e627b66e3 (patch)
treee6b32d4c0c03354a4c6dc5df65780b5d96b9336e /sound/soc/sh/rcar
parentMerge remote-tracking branches 'asoc/topic/wm9712', 'asoc/topic/wm9713' and '... (diff)
downloadlinux-0ea617a298dcdc2251b4e10f83ac3f3e627b66e3.tar.xz
linux-0ea617a298dcdc2251b4e10f83ac3f3e627b66e3.zip
ASoC: rsnd: don't double free kctrl
On an error, snd_ctl_add already free's kctrl, so calling snd_ctl_free_one to free it again leads to a double free error. Fix this by removing the extraneous snd_ctl_free_one call. Issue found using static analysis with CoverityScan, CID 1372908 Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar')
-rw-r--r--sound/soc/sh/rcar/core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 4bd68de76130..99b5b0835c1e 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1030,10 +1030,8 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod,
return -ENOMEM;
ret = snd_ctl_add(card, kctrl);
- if (ret < 0) {
- snd_ctl_free_one(kctrl);
+ if (ret < 0)
return ret;
- }
cfg->update = update;
cfg->card = card;