Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4701993ybg; Tue, 29 Oct 2019 11:06:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQPfunkgdqq+li6xmnBYW+znmqQ6lxdvpOGh5zt7G6xAxqVz5gn7tqKuPsAT0ccWG73/Zr X-Received: by 2002:a17:906:e8d:: with SMTP id p13mr4640602ejf.159.1572372407664; Tue, 29 Oct 2019 11:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572372407; cv=none; d=google.com; s=arc-20160816; b=1AXDlPqKEpxwexjAITy8paIqkl06kfkdUyTPczdSd8sQT15TJs1mknlKVpbDAF6iSp OknXomllduq7qBPjH0jus48HwGWGXcAMz0gZA40JkuMdL/UVIPo5JqLjkiFB2jByWNd1 lNsItC2Hdsr9GsYD3yEI31PuQlCkHmXEFPe4lb0My7BfP1m8I8qSLvIxe1qnlOcUz72d DpRXwDpF/BECXgTJ04otAyXxFv2Lg0Dmp7s4d+iSQl1TOl3a7KKjIay57GLJQPi/EVGJ LSauPvmaqFWeM43LXVJgU7Y4BLEbOI7HQYLP15QipzzcowE0Kuz5UKcuMT67uzePydck 0/7Q== 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=NZPXKF451baogQaGRKEJ5wdVk5VESGt8xc8CgP5E5cM=; b=tfez+z6iiXTCBNESDfUFxAAc6vTBSHMMhXDXmMYgIyu/NRsFOoH0Ba29qxeplyQmjO nOEHTbcqjD2KdfoIXRiGiIXM9FjWKxRodmbUGovwceM6PSHux1z2u2awvk4UoF3f3cjt y6tu7eHuwtRT7n3nWI8tdnXx84wrgoJnKaGTBLsM6i6QG235yWi2IW98UJPAPlBU6u91 jasP/+a5gPCr/Mw5DjRZB4Okc8gxwJANmQS8BHaKCqsfSzRRur9TMmxFC9MjD9pUQP3W QRjoYob1ExNisnUtrXi2MTrGvrJBdpm5pHh5CplLg8xmTBygwHVBjOA1qtyA7/Gf2867 s/5A== 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 qx10si7925927ejb.27.2019.10.29.11.06.23; Tue, 29 Oct 2019 11:06:47 -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 S1728337AbfJ2LWt convert rfc822-to-8bit (ORCPT + 99 others); Tue, 29 Oct 2019 07:22:49 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:49171 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbfJ2LWt (ORCPT ); Tue, 29 Oct 2019 07:22:49 -0400 X-Originating-IP: 91.217.168.176 Received: from xps13 (unknown [91.217.168.176]) (Authenticated sender: miquel.raynal@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 943B840008; Tue, 29 Oct 2019 11:22:46 +0000 (UTC) Date: Tue, 29 Oct 2019 12:22:47 +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] mtd: devices: phram.c: Fix multiple kfree statement from phram_setup Message-ID: <20191029122247.73e1c573@xps13> In-Reply-To: <20191028181300.GA26250@saurav> References: <20191028181300.GA26250@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 Hi Saurav, Saurav Girepunje wrote on Mon, 28 Oct 2019 23:43:01 +0530: > Remove multiple kfree statement from phram_setup() in phram.c > > Signed-off-by: Saurav Girepunje > --- Here you should add a changelog with the changes you have done since the last version. Also when formatting the patch use -v to add a version prefix into the title, like [PATCH v]. > 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; s/nam/name > } > > ret = parse_num64(&len, token[2]); > if (ret) { > - kfree(name); > parse_err("illegal device length\n"); > + goto free_nam; > } > > ret = register_device(name, start, len); > if (!ret) > pr_info("%s device: %#llx at %#llx\n", name, len, start); > - else > - kfree(name); > > +free_nam: > + kfree(name); > return ret; > } > Thanks, Miquèl