diff options
author | Evgeny Novikov <novikov@ispras.ru> | 2020-08-06 10:26:34 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-09-30 16:44:16 +0200 |
commit | cb7dc3178a9862614b1e7567d77f4679f027a074 (patch) | |
tree | 4c2692d26c613bb2df2389e562f1227cb593e41a /drivers/mtd | |
parent | d43511d05cd41c987c26a122c4c49cae382c5c99 (diff) | |
download | linux-cb7dc3178a9862614b1e7567d77f4679f027a074.tar.gz linux-cb7dc3178a9862614b1e7567d77f4679f027a074.tar.bz2 linux-cb7dc3178a9862614b1e7567d77f4679f027a074.zip |
mtd: rawnand: vf610: disable clk on error handling path in probe
vf610_nfc_probe() does not invoke clk_disable_unprepare() on one error
handling path. The patch fixes that.
Found by Linux Driver Verification project (linuxtesting.org).
Fixes: 6f0ce4dfc5a3 ("mtd: rawnand: vf610: Avoid a potential NULL pointer dereference")
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200806072634.23528-1-novikov@ispras.ru
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/raw/vf610_nfc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c index 50dc0c93140c..3c4090bd3f28 100644 --- a/drivers/mtd/nand/raw/vf610_nfc.c +++ b/drivers/mtd/nand/raw/vf610_nfc.c @@ -852,8 +852,10 @@ static int vf610_nfc_probe(struct platform_device *pdev) } of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev); - if (!of_id) - return -ENODEV; + if (!of_id) { + err = -ENODEV; + goto err_disable_clk; + } nfc->variant = (enum vf610_nfc_variant)of_id->data; |