aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaishali Thakkar <[email protected]>2015-02-10 14:09:40 -0800
committerLinus Torvalds <[email protected]>2015-02-10 14:30:30 -0800
commit7c4da061f2e953df479b126b9263f0e845bce0ec (patch)
tree4aba59e0f24dd541445c2aeb79cdba2382498401
parent94e4d712eb28c9a87c40c898af540725f63e68eb (diff)
mm/slab_common.c: use kmem_cache_free()
Here, free memory is allocated using kmem_cache_zalloc. So, use kmem_cache_free instead of kfree. This is done using Coccinelle and semantic patch used 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: Vaishali Thakkar <[email protected]> Acked-by: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/slab_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index e03dd6f2a272..67f182c10f24 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -331,7 +331,7 @@ out:
out_free_cache:
memcg_free_cache_params(s);
- kfree(s);
+ kmem_cache_free(kmem_cache, s);
goto out;
}