Author: Julia Lawall <julia.lawall@lip6.fr> devm_kzalloc should not be followed by kfree, as this results in a double free. The problem was found using the following semantic match (http://coccinelle.lip6.fr/): // @@ expression x,e; @@ x = devm_kzalloc(…) … when != x = e ?-kfree(x,…); // Furthermore, in the remove function, the calls to free_irq are moved …