[alsa-devel] [PATCH 3/3] sound/soc/soc-core.c: drop kfree of devm_kzalloc's data
From: Julia Lawall Julia.Lawall@lip6.fr
Using kfree to free data allocated with devm_kzalloc causes double frees.
The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @@ expression x; @@
x = devm_kzalloc(...) ... ?-kfree(x); // </smpl>
Signed-off-by: Julia Lawall Julia.Lawall@lip6.fr
--- The kfrees were introduced in b761c0ca. I sent this a few months ago, and I still think it should be applied...
sound/soc/soc-core.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f81c597..86d7a36 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -4136,7 +4136,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, dev_err(card->dev, "Property '%s' index %d could not be read: %d\n", propname, 2 * i, ret); - kfree(routes); return -EINVAL; } ret = of_property_read_string_index(np, propname, @@ -4145,7 +4144,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, dev_err(card->dev, "Property '%s' index %d could not be read: %d\n", propname, (2 * i) + 1, ret); - kfree(routes); return -EINVAL; } }
On Sat, Dec 08, 2012 at 07:01:20PM +0100, Julia Lawall wrote:
The kfrees were introduced in b761c0ca. I sent this a few months ago, and I still think it should be applied...
I'm missing patches 1 and 2?
On Mon, 10 Dec 2012, Mark Brown wrote:
On Sat, Dec 08, 2012 at 07:01:20PM +0100, Julia Lawall wrote:
The kfrees were introduced in b761c0ca. I sent this a few months ago, and I still think it should be applied...
I'm missing patches 1 and 2?
Sorry, I just resent the patch as is. 1 and 2 were I guess applied, because I odn't findthe problem any more.
julia
On Mon, Dec 10, 2012 at 07:10:16AM +0100, Julia Lawall wrote:
Sorry, I just resent the patch as is. 1 and 2 were I guess applied, because I odn't findthe problem any more.
It looks like this is what happened the first time round as well - I only got patch 3 but it was flagged as part of a three patch series. Please don't do things like this, it makes the patch look like part of a series which has already been applied but didn't get deleted when it's sitting in an inbox.
On Sat, Dec 08, 2012 at 07:01:20PM +0100, Julia Lawall wrote:
From: Julia Lawall Julia.Lawall@lip6.fr
Using kfree to free data allocated with devm_kzalloc causes double frees.
Ugh, actually this doesn't merge down very well against -next at all, can you regenerate against current code please?
participants (2)
-
Julia Lawall
-
Mark Brown