From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by kanga.kvack.org (Postfix) with ESMTP id C741B6B0032 for ; Tue, 10 Feb 2015 16:51:36 -0500 (EST) Received: by iecrd18 with SMTP id rd18so16201309iec.5 for ; Tue, 10 Feb 2015 13:51:36 -0800 (PST) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com. [209.85.223.182]) by mx.google.com with ESMTPS id n7si167758igj.44.2015.02.10.13.51.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 13:51:36 -0800 (PST) Received: by iery20 with SMTP id y20so19846764ier.9 for ; Tue, 10 Feb 2015 13:51:36 -0800 (PST) Date: Tue, 10 Feb 2015 13:51:34 -0800 (PST) From: David Rientjes 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> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Vaishali Thakkar Cc: Stephen Rothwell , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org