Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934306AbaGXIJO (ORCPT ); Thu, 24 Jul 2014 04:09:14 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:43803 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934120AbaGXIJI (ORCPT ); Thu, 24 Jul 2014 04:09:08 -0400 MIME-Version: 1.0 In-Reply-To: <20140723214707.GA8100@himangi-Dell> References: <20140723214707.GA8100@himangi-Dell> Date: Thu, 24 Jul 2014 12:09:06 +0400 Message-ID: Subject: Re: [PATCH] rbd: Use rbd_segment_name_free From: Ilya Dryomov To: Himangi Saraogi Cc: Yehuda Sadeh , Sage Weil , Alex Elder , Ceph Development , Linux Kernel Mailing List , Julia Lawall Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 24, 2014 at 1:47 AM, Himangi Saraogi wrote: > 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 Applied. Thanks, Ilya -- 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/