[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180324111820.GA1997@seema-Inspiron-15-3567>
Date: Sat, 24 Mar 2018 16:48:20 +0530
From: Arushi Singhal <arushisinghal19971997@...il.com>
To: dwmw2@...radead.org
Cc: Brian Norris <computersforpeace@...il.com>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Marek Vasut <marek.vasut@...il.com>,
Richard Weinberger <richard@....at>,
Cyrille Pitchen <cyrille.pitchen@...ev4u.fr>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mtd: devices: check mtd_device_register() return code
stfsm_probe() misses error handling of mtd_device_register().
Signed-off-by: Arushi Singhal <arushisinghal19971997@...il.com>
---
drivers/mtd/devices/st_spi_fsm.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 7bc29d7..4a99a6a 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -2125,7 +2125,13 @@ static int stfsm_probe(struct platform_device *pdev)
(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
- return mtd_device_register(&fsm->mtd, NULL, 0);
+ ret = mtd_device_register(&fsm->mtd, NULL, 0);
+ if (ret) {
+ pr_err("Failed to register device\n");
+ goto err_clk_unprepare;
+ }
+
+ return 0;
err_clk_unprepare:
clk_disable_unprepare(fsm->clk);
--
2.7.4
Powered by blists - more mailing lists