lkml.org 
[lkml]   [2015]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/slab_common: Use kmem_cache_free
On Mon, 9 Feb 2015, Vaishali Thakkar wrote:

> 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 <vthakkar1994@gmail.com>

Acked-by: David Rientjes <rientjes@google.com>


\
 
 \ /
  Last update: 2015-02-10 23:01    [W:0.078 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site