提交 8d249378 编写于 作者: J Julia Lawall 提交者: Samuel Ortiz

mfd: palmas: Drop kfree of devm_kzalloc's data

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: NJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 a91d2f8d
......@@ -464,7 +464,6 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c,
err:
mfd_remove_devices(palmas->dev);
kfree(palmas);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册