[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171118132723.24785-1-christophe.jaillet@wanadoo.fr>
Date: Sat, 18 Nov 2017 14:27:23 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: kyungmin.park@...sung.com, dwmw2@...radead.org,
computersforpeace@...il.com, boris.brezillon@...e-electrons.com,
marek.vasut@...il.com, richard@....at, cyrille.pitchen@...ev4u.fr
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] mtd: onenand: Fix an error handling path in 's3c_onenand_probe(()'
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 <christophe.jaillet@...adoo.fr>
---
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),
--
2.14.1
Powered by blists - more mailing lists