From patchwork Sat Nov 18 13:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 839244 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LY99UF7i"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yfG5S11zXz9ryQ for ; Sun, 19 Nov 2017 00:28:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Q4dq0vBTV5nziAZ64qFvW1U9xB8AHoZR/en73m6lGzI=; b=LY9 9UF7i8a97pg//ErW41PB9v5kklwtqWYPs9xH305UtttQTa7sfAL8HwHD14LxbplyN7RptPsRMvXAK UIvGkxpTBWF99Yr/D4UJrS8gNXv0YMbO7yCtUyUdgoQgbW91KFCoeayyPI3fjYZ23OzgJHOCQ8gGN qpfYYRm/RHgn9EX1HVHVucgb9bKrpBcm6RnGXNup7UNMn1qrP/qo0kkNDFVQN4ftQESMQCVMJVAS5 TfJxJLQTO1hwSQXSZCGiyCfax8rQsIQ5cSy5Rt9E2EhX/urgBldgPmmDWfsYppOeahams5pWsLdCi 251mqzRZ+VI8sxphOHOkZ8n63pTjruQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eG3AT-0007jJ-D1; Sat, 18 Nov 2017 13:28:21 +0000 Received: from smtp09.smtpout.orange.fr ([80.12.242.131] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eG3AP-0007gb-L3 for linux-mtd@lists.infradead.org; Sat, 18 Nov 2017 13:28:19 +0000 Received: from localhost.localdomain ([86.196.182.67]) by mwinf5d18 with ME id bRTm1w0021TfVo603RTmxV; Sat, 18 Nov 2017 14:27:51 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 18 Nov 2017 14:27:51 +0100 X-ME-IP: 86.196.182.67 From: Christophe JAILLET To: kyungmin.park@samsung.com, dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@free-electrons.com, marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr Subject: [PATCH] mtd: onenand: Fix an error handling path in 's3c_onenand_probe(()' Date: Sat, 18 Nov 2017 14:27:23 +0100 Message-Id: <20171118132723.24785-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_052817_987723_81A6E1F1 X-CRM114-Status: UNSURE ( 7.59 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.7 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.12.242.131 listed in list.dnswl.org] -2.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [80.12.242.131 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (christophe.jaillet[at]wanadoo.fr) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If 'platform_get_resource()' fails, we have to go through the error handling path to release some resources. The unreachable 'goto ahb_resource_failed' is also wrong here and we should go to 'resource_failed' instead. Signed-off-by: Christophe JAILLET --- drivers/mtd/onenand/samsung.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index af0ac1a7bf8f..164ebe2b1137 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c @@ -872,8 +872,8 @@ static int s3c_onenand_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!r) { dev_err(&pdev->dev, "no memory resource defined\n"); - return -ENOENT; - goto ahb_resource_failed; + err = -ENOENT; + goto resource_failed; } onenand->base_res = request_mem_region(r->start, resource_size(r),