* [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control()
@ 2013-05-14 12:02 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-05-14 12:02 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, Takashi Iwai, patches, kernel-janitors, Liam Girdwood
There are two return paths which don't kfree(name).
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
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;
^ permalink raw reply related [flat|nested] 6+ messages in thread* [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control()
@ 2013-05-14 12:02 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-05-14 12:02 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, Takashi Iwai, patches, kernel-janitors, Liam Girdwood
There are two return paths which don't kfree(name).
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
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;
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control()
2013-05-14 12:02 ` Dan Carpenter
@ 2013-05-14 12:34 ` Dimitris Papastamos
-1 siblings, 0 replies; 6+ messages in thread
From: Dimitris Papastamos @ 2013-05-14 12:34 UTC (permalink / raw)
To: Dan Carpenter
Cc: alsa-devel, patches, Takashi Iwai, Mark Brown, kernel-janitors,
Liam Girdwood
On Tue, May 14, 2013 at 03:02:44PM +0300, Dan Carpenter wrote:
> There are two return paths which don't kfree(name).
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Looks good.
Thanks,
Dimitris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control()
@ 2013-05-14 12:34 ` Dimitris Papastamos
0 siblings, 0 replies; 6+ messages in thread
From: Dimitris Papastamos @ 2013-05-14 12:34 UTC (permalink / raw)
To: Dan Carpenter
Cc: alsa-devel, patches, Takashi Iwai, Mark Brown, kernel-janitors,
Liam Girdwood
On Tue, May 14, 2013 at 03:02:44PM +0300, Dan Carpenter wrote:
> There are two return paths which don't kfree(name).
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Looks good.
Thanks,
Dimitris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control()
2013-05-14 12:02 ` Dan Carpenter
@ 2013-05-14 12:40 ` Mark Brown
-1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2013-05-14 12:40 UTC (permalink / raw)
To: Dan Carpenter
Cc: Takashi Iwai, alsa-devel, patches, kernel-janitors, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 135 bytes --]
On Tue, May 14, 2013 at 03:02:44PM +0300, Dan Carpenter wrote:
> There are two return paths which don't kfree(name).
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [alsa-devel] [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control()
@ 2013-05-14 12:40 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2013-05-14 12:40 UTC (permalink / raw)
To: Dan Carpenter
Cc: Takashi Iwai, alsa-devel, patches, kernel-janitors, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 135 bytes --]
On Tue, May 14, 2013 at 03:02:44PM +0300, Dan Carpenter wrote:
> There are two return paths which don't kfree(name).
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-14 12:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 12:02 [patch] ASoC: wm_adsp: memory leak in wm_adsp_create_control() Dan Carpenter
2013-05-14 12:02 ` Dan Carpenter
2013-05-14 12:34 ` Dimitris Papastamos
2013-05-14 12:34 ` Dimitris Papastamos
2013-05-14 12:40 ` Mark Brown
2013-05-14 12:40 ` [alsa-devel] " Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.