mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed May 10 19:59:13 PDT 2017


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0a5165a83c624cddb3dfa227a9324acac9ec413c
Commit:     0a5165a83c624cddb3dfa227a9324acac9ec413c
Parent:     c1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201
Author:     Alexey Khoroshilov <khoroshilov at ispras.ru>
AuthorDate: Sat Feb 18 01:08:17 2017 +0300
Committer:  Cyrille Pitchen <cyrille.pitchen at atmel.com>
CommitDate: Tue Mar 7 21:45:48 2017 +0100

    mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure
    
    hisi_spi_nor_probe() ignores clk_prepare_enable() error code.
    The patch fixes that.
    
    Found by Linux Driver Verification project (linuxtesting.org).
    
    Signed-off-by: Alexey Khoroshilov <khoroshilov at ispras.ru>
    Acked-by: Marek Vasut <marek.vasut at gmail.com>
    Signed-off-by: Cyrille Pitchen <cyrille.pitchen at atmel.com>
---
 drivers/mtd/spi-nor/hisi-sfc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/hisi-sfc.c b/drivers/mtd/spi-nor/hisi-sfc.c
index 20378b0..a286350 100644
--- a/drivers/mtd/spi-nor/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/hisi-sfc.c
@@ -448,8 +448,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
 	if (!host->buffer)
 		return -ENOMEM;
 
+	ret = clk_prepare_enable(host->clk);
+	if (ret)
+		return ret;
+
 	mutex_init(&host->lock);
-	clk_prepare_enable(host->clk);
 	hisi_spi_nor_init(host);
 	ret = hisi_spi_nor_register_all(host);
 	if (ret)



More information about the linux-mtd-cvs mailing list