Skip to content

Commit

Permalink
mfd: palmas: Drop kfree of devm_kzalloc's data
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Julia Lawall authored and Samuel Ortiz committed Sep 17, 2012
1 parent a91d2f8 commit 8d24937
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/mfd/palmas.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c,

err:
mfd_remove_devices(palmas->dev);
kfree(palmas);
return ret;
}

Expand Down

0 comments on commit 8d24937

Please sign in to comment.