Skip to content

Commit

Permalink
mtd: rawnand: vf610: disable clk on error handling path in probe
Browse files Browse the repository at this point in the history
[ 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>
  • Loading branch information
eunovm authored and gregkh committed Oct 29, 2020
1 parent fbb2d15 commit 86cb4ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mtd/nand/raw/vf610_nfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 86cb4ae

Please sign in to comment.