From: Himangi Saraogi Date: Wed, 23 Jul 2014 21:47:07 +0000 (+0530) Subject: rbd: use rbd_segment_name_free() instead of kfree() X-Git-Tag: omap-for-v3.17/fixes-against-rc2~85^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d5079aa8bc9ca25e61576820d07503b2a558f9b;p=pandora-kernel.git rbd: use rbd_segment_name_free() instead of kfree() Free memory allocated using kmem_cache_zalloc using kmem_cache_free rather than kfree. The helper rbd_segment_name_free does the job here. Its position is shifted above the calling function. The Coccinelle semantic patch that detects this change is as follows: // @@ expression x,E,c; @@ x = \(kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\)(c,...) ... when != x = E when != &x ?-kfree(x) +kmem_cache_free(c,x) // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: Ilya Dryomov --- Reading git-diff-tree failed