Skip to content

Commit a3623e1

Browse files
ISCAS-Vulabmiquelraynal
authored andcommitted
mtd: rawnand: renesas: Handle devm_pm_runtime_enable() errors
devm_pm_runtime_enable() can fail due to memory allocation failures. The current code ignores its return value and proceeds with pm_runtime_resume_and_get(), which may operate on incorrectly initialized runtime PM state. Check the return value of devm_pm_runtime_enable() and return the error code if it fails. Fixes: 6a2277a ("mtd: rawnand: renesas: Use runtime PM instead of the raw clock API") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 41bdec1 commit a3623e1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/mtd/nand/raw/renesas-nand-controller.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,10 @@ static int rnandc_probe(struct platform_device *pdev)
13361336
if (IS_ERR(rnandc->regs))
13371337
return PTR_ERR(rnandc->regs);
13381338

1339-
devm_pm_runtime_enable(&pdev->dev);
1339+
ret = devm_pm_runtime_enable(&pdev->dev);
1340+
if (ret)
1341+
return ret;
1342+
13401343
ret = pm_runtime_resume_and_get(&pdev->dev);
13411344
if (ret < 0)
13421345
return ret;

0 commit comments

Comments
 (0)