Skip to content

Commit 04ca4c9

Browse files
eunovmgregkh
authored andcommitted
mtd: rawnand: vf610: disable clk on error handling path in probe
[ Upstream commit cb7dc31 ] 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: 6f0ce4d ("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4d14fc2 commit 04ca4c9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/mtd/nand/raw/vf610_nfc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,10 @@ static int vf610_nfc_probe(struct platform_device *pdev)
852852
}
853853

854854
of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev);
855-
if (!of_id)
856-
return -ENODEV;
855+
if (!of_id) {
856+
err = -ENODEV;
857+
goto err_disable_clk;
858+
}
857859

858860
nfc->variant = (enum vf610_nfc_variant)of_id->data;
859861

0 commit comments

Comments
 (0)