]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs/ocfs2/dlm/dlmlock.c: free kmem_cache_zalloc'd data using kmem_cache_free
authorJulia Lawall <julia@diku.dk>
Sat, 9 Jul 2011 16:04:39 +0000 (18:04 +0200)
committerJoel Becker <jlbec@evilplan.org>
Mon, 22 Aug 2011 04:25:40 +0000 (21:25 -0700)
commit677cb1efc604d2b0ec77a0a9da7790e2c319375a
tree08224239784158d8f1274a01e5bc353b1a0621b3
parentd27fb6a99c41428464a60a4a76839c0c31366faf
fs/ocfs2/dlm/dlmlock.c: free kmem_cache_zalloc'd data using kmem_cache_free

Memory allocated using kmem_cache_zalloc should be freed using
kmem_cache_free, not kfree.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,e,e1,e2;
@@

x = kmem_cache_zalloc(e1,e2)
... when != x = e
?-kfree(x)
+kmem_cache_free(e1,x)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
fs/ocfs2/dlm/dlmlock.c