Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp578036ybx; Wed, 30 Oct 2019 01:21:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8l+0pbP+7SL5T5u9qPB2ND1OVImW+hX/fOZFE6wUZxZITDKxYneNTPV2fyuwfgIxRHUjN X-Received: by 2002:a50:fb18:: with SMTP id d24mr16790055edq.216.1572423714691; Wed, 30 Oct 2019 01:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572423714; cv=none; d=google.com; s=arc-20160816; b=c1aAZKxReolC+Rjk0zHV5R1yCVyqK/65xh4E7N6+wzj6X0eksmrLdTjCnMJY4oitD+ QxRY4yZWpOmp4m5l7ZaFmZrUjouBLk8I3VWtNdNDLFlImPXZ1pY9RaWbogdy3usOTbVT 9geRheoPEOgAJoVBgwrNdZJx3FQz3EOzqN3tou7LkxTQb21xPmgHwieJ6stWUsjElPqV qgiGxI2pcZd7v+XHrCcdlTScu1iyPd19u3+ZvDNFKP+sup7BdOJhYUfyyjNVosquKqdp 6NO2PdkZ3NUivG6dVmDzLW/bTok+Adrbt4q78xRRV8iW10OlFU5oyxSmOLCJcgC6JFPi mJQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=yKNEagSgHpM2IXBD+tWJSnvFZ1G4dyhcUCiAvrr3vPo=; b=scHBYb+CubmsYWq/Fu2hpDhXPfnNlM1KOZ2O2c7V7C+ZtKH2qQ/0JJjUTYnkasl5LA 6oV+sniWNEcuHNgbSG88iFaAMWAvRHTvla/y8KCoMkTw/fgN4RBBaQuSkFOwnvyyc2ZO LZAdFUIN8hr0yHNYwP4XJOyt1w3IWeEwVNuQHxpX/zgS2fUQJBJuEmXx9hraL1YowKZ/ JdJDJnGU9m0xEWkenNcznGHO8DTeUMlKxqHhxq/iUWYqmRy7Ro+n3mfTSU4xzG8CwaoV AiJGAsUuiiLw/zBjv240CSTlzPgBLOMh6XxsZFudcxrPVkqPnUMJanN/unHUdO4FfQ5F 531A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g43si957999edg.203.2019.10.30.01.21.30; Wed, 30 Oct 2019 01:21:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726104AbfJ3IUk convert rfc822-to-8bit (ORCPT + 99 others); Wed, 30 Oct 2019 04:20:40 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:35385 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725923AbfJ3IUk (ORCPT ); Wed, 30 Oct 2019 04:20:40 -0400 Received: from xps13 (67.173.185.81.rev.sfr.net [81.185.173.67]) (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 0599F200011; Wed, 30 Oct 2019 08:20:35 +0000 (UTC) Date: Wed, 30 Oct 2019 09:20:36 +0100 From: Miquel Raynal To: Saurav Girepunje Cc: joern@lazybastard.org, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com Subject: Re: [PATCH v1] mtd: devices: phram.c: Fix multiple kfree statement from phram_setup Message-ID: <20191030092036.38cf4f11@xps13> In-Reply-To: <20191029170849.GA6279@saurav> References: <20191029170849.GA6279@saurav> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Saurav, Saurav Girepunje wrote on Tue, 29 Oct 2019 22:38:49 +0530: Are you a robot? > Remove multiple kfree statement from phram_setup() in phram.c This does not describe what you are doing, you don't remove them you factorize them. And honestly I am not convinced this change is useful in old code. > > Signed-off-by: Saurav Girepunje > --- > > Change in v1: Your first version is v1, how can you be at v1? It is almost v3 already! > > - Add change suggested by Miquel Raynal > "The goto statement should not describe from where it is called but the > action it is supposed to take. 'goto free_nam;' would be better." This is a copy/paste of what I have said. What I want you to write is: " - Rename the goto statement to describe bla bla bla. - Fix the typo in the goto label. " > > drivers/mtd/devices/phram.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c > index c467286ca007..38f95a1517ac 100644 > --- a/drivers/mtd/devices/phram.c > +++ b/drivers/mtd/devices/phram.c > @@ -243,22 +243,22 @@ static int phram_setup(const char *val) > > ret = parse_num64(&start, token[1]); > if (ret) { > - kfree(name); > parse_err("illegal start address\n"); > + goto free_nam; Come one... Thanks, Miquèl