Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754553AbbBJVvi (ORCPT ); Tue, 10 Feb 2015 16:51:38 -0500 Received: from mail-ie0-f171.google.com ([209.85.223.171]:40098 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbbBJVvg (ORCPT ); Tue, 10 Feb 2015 16:51:36 -0500 Date: Tue, 10 Feb 2015 13:51:34 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Vaishali Thakkar cc: Stephen Rothwell , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slab_common: Use kmem_cache_free In-Reply-To: <20150209052835.GA3559@vaishali-Ideapad-Z570> Message-ID: References: <20150209052835.GA3559@vaishali-Ideapad-Z570> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 767 Lines: 26 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 Acked-by: David Rientjes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/