Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4642079ybg; Tue, 29 Oct 2019 10:10:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxz4XE5LSyiwIp6VeSz+rbtzg7TBoOGjMIjaaJtz9aVZ2Gx+hOJ6YxGTUj01CkttRhAceN X-Received: by 2002:a17:906:6d84:: with SMTP id h4mr4473936ejt.262.1572369008068; Tue, 29 Oct 2019 10:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572369008; cv=none; d=google.com; s=arc-20160816; b=zOAPWMTIyAxazC85Gl8jggQSUPOMxUYuv0+JrEnJmaLW2fwM4UBGNvGCtezItSlCdB J5bx2NOLi+t0uTg5aUZx15Img06qTs8jbgKGswEi9e10MIhJFvNUy1h+7A0+8nlZY6iT P65pl/ykxzF7rATWyDMt9a2bjOOpUif18xSpyjtpwzyChwYfTxgZvIDH5ykAepoIZIHg XY39wyuxxwFRcdAV4V9lTSU68r0zhIELXrhhqTYHYLQA1Sp53Wgyu4F3qeaF+VIvDNwL F7gJAGBBlF62gAaelImJWifDGUD99TfBo0VSNogGQ8iTBff+KEV/qMyQKLck1M2J0H/5 I9mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=aoq6jyjkoC3LpN2Vxb6LSXbZ7+YI0W6uo+6lRedmGDE=; b=wjf8OmCBBrQncEuYCwGK/bQIZoVZ4aMVu+lNLMzQ9Fbba1OTAeZsxpIXfviRoNBS7F X2let2rPTQHfN9F8t9znOSlxjXgnxHdltB+xqdm/5XzrE1L6AZW+9bomJsXbC5s7Apmy ki+Rzx01G0IcB5rNdVEdOTfOWDYGL21Byel1Wp8JaH+/R7gsJFQGWPFgl2BUL1EHgZbZ CtfZX7EdI3YIpLVTUI8v7/6Wv6qwSBfeWnnn8YzPqVQoFNUgr9AQogk90u4Py4QGj+hU 3EyH3u/Tl61TC7wA0dtVDRKU+WnsF2QBwEEz5n1GKQeD2yuuParxQAFNqrZKChwqUGhO xLfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tH1vqV7j; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si10258780edd.140.2019.10.29.10.09.43; Tue, 29 Oct 2019 10:10:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tH1vqV7j; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390632AbfJ2RJB (ORCPT + 99 others); Tue, 29 Oct 2019 13:09:01 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41539 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727692AbfJ2RJB (ORCPT ); Tue, 29 Oct 2019 13:09:01 -0400 Received: by mail-pf1-f195.google.com with SMTP id p26so5878479pfq.8 for ; Tue, 29 Oct 2019 10:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=aoq6jyjkoC3LpN2Vxb6LSXbZ7+YI0W6uo+6lRedmGDE=; b=tH1vqV7j2AqRq678Xfjq3gRUPwBGXd8w1sEUZwdL9SAx56yGie9zKFY8TI/UUNvK+Z mHGRXsyubOzva7SVlwrAlyjrtlkvn2ryMDjR6fs01Bfv8yKZOS2KNVvYqHzcIFvW9zX0 CXcOWcGOhh6vbAa/xPZPvHKByOFDfTtaQxT/4+zwnOHBJ1cLjDdVBaX8sRm1fWV0nfbW G63MtcQWbN44+cB/XV+w4a780UjE3Sk9Xlugk+qudl7qAVmnC6u7oP1fftT87lUMwowQ 6/zdg/TB0USvZlBBq5kFcN8sFgFXZDP5gt4pHBri8zevrZwDj7pfBrM3kKj9TFj89+6+ CZlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=aoq6jyjkoC3LpN2Vxb6LSXbZ7+YI0W6uo+6lRedmGDE=; b=PUSeJ5FnND1TWuwRdByDODqWeNmpN4HclnbiRYDdT7IQzm8jk1axpN/t1Z6UDogEww IEh8EUR+7l/aueJMLw72qL1J7f+mhDeCLjNMm5wg/KjcL11lkhkkgZMJIiV5dlvDTadL Bol9mAHlmM4e5pJJeRe2PgJUWKlUMrVt73AY5norJoO8gWxeZ4j2p0hStdwJ8DyUWBBr alnDnD40VfMafCkg7LDlMjgAvc9x9o2Y4/Doxe0uj50fHs46Ff1A1ZGCcwNPG7F0Crlu 4jRUi3ye+3rimdUJXKq+l2oTNJbGXMzs8dUpDq4E8awtmqgqEHQiZYUQ3wWeNV/QKo5M LPzQ== X-Gm-Message-State: APjAAAX9KECGGcAYMgjMrZVVGSR5lNkZOaAYqkITszksAZbg2+wmakQy ceenBRPOmpBmOeR9PurnZlE= X-Received: by 2002:a63:2d81:: with SMTP id t123mr28815254pgt.306.1572368939385; Tue, 29 Oct 2019 10:08:59 -0700 (PDT) Received: from saurav ([117.232.226.35]) by smtp.gmail.com with ESMTPSA id o12sm13253177pgl.86.2019.10.29.10.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:08:57 -0700 (PDT) Date: Tue, 29 Oct 2019 22:38:49 +0530 From: Saurav Girepunje To: joern@lazybastard.org, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Subject: [PATCH v1] mtd: devices: phram.c: Fix multiple kfree statement from phram_setup Message-ID: <20191029170849.GA6279@saurav> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove multiple kfree statement from phram_setup() in phram.c Signed-off-by: Saurav Girepunje --- Change in v1: - 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." 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; } 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; } -- 2.20.1