summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-05-14 15:02:44 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-14 16:39:59 +0400
commit9dbce04402e33e362e3e946c437bc70b8102a95d (patch)
treed4606f2b17771f27bbf3e2e3f67f91b6c0acd5a8 /sound/soc/codecs/wm_adsp.c
parent6ab2b7b415441fa46357bef883e1ead086de1387 (diff)
downloadop-kernel-dev-9dbce04402e33e362e3e946c437bc70b8102a95d.zip
op-kernel-dev-9dbce04402e33e362e3e946c437bc70b8102a95d.tar.gz
ASoC: wm_adsp: memory leak in wm_adsp_create_control()
There are two return paths which don't kfree(name). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r--sound/soc/codecs/wm_adsp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 1378306..d715c8e 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -836,7 +836,8 @@ static int wm_adsp_create_control(struct snd_soc_codec *codec,
region_name = "ZM";
break;
default:
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_name;
}
snprintf(name, PAGE_SIZE, "DSP%d %s %x",
@@ -847,7 +848,7 @@ static int wm_adsp_create_control(struct snd_soc_codec *codec,
if (!strcmp(ctl->name, name)) {
if (!ctl->enabled)
ctl->enabled = 1;
- return 0;
+ goto found;
}
}
@@ -887,6 +888,7 @@ static int wm_adsp_create_control(struct snd_soc_codec *codec,
INIT_WORK(&ctl_work->work, wm_adsp_ctl_work);
schedule_work(&ctl_work->work);
+found:
kfree(name);
return 0;
OpenPOWER on IntegriCloud