From: Julia Lawall Date: Fri, 5 Oct 2012 20:23:52 +0000 (+0200) Subject: i2c-smbus: Convert kzalloc to devm_kzalloc X-Git-Tag: v3.7-rc1~92^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71b578452ec6b2e8a470e3dae89055cd1068a9f0;p=pandora-kernel.git i2c-smbus: Convert kzalloc to devm_kzalloc Converting kzalloc to devm_kzalloc simplifies the code and ensures that the result, alert, is freed after the irq allocated by the subsequent devm_request_irq. This in turn ensures that when an interrupt can be triggered, the alert structure is still available. The problem of a free after a devm_request_irq was found using the following semantic match (http://coccinelle.lip6.fr/) // @r exists@ expression e1,e2,x,a,b,c,d; identifier free; position p1,p2; @@ devm_request_irq@p1(e1,e2,...,x) ... when any when != e2 = a when != x = b if (...) { ... when != e2 = c when != x = d free@p2(...,x,...); ... return ...; } // Signed-off-by: Julia Lawall Signed-off-by: Jean Delvare --- Reading git-diff-tree failed