Skip to contentSkip to conversation

mailbox: omap: Handle devm_pm_runtime_enable() errors

PATCH New Haotian Zhang 1 participant 1 message Nov 23, 2025 Mailbox API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: omap: Handle devm_pm_runtime_enable() errors

Although unlikely, devm_pm_runtime_enable() can fail due to memory allocations. Without proper error handling, the subsequent pm_runtime_resume_and_get() call may operate on incorrectly initialized runtime PM state.

Add error handling to check the return value of
devm_pm_runtime_enable() and return on failure.

Fixes e4e8b1fe742f ("mailbox: omap: Use devm_pm_runtime_enable() helper")
---
 drivers/mailbox/omap-mailbox.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mailbox/omap-mailbox.c +3 -1
index 680243751d62..e4fb8ffdde37 100644
@@ -579,7 +579,9 @@ static int omap_mbox_probe(struct platform_device *pdev)
 		return ret;
 
 	platform_set_drvdata(pdev, mdev);
-	devm_pm_runtime_enable(mdev->dev);
+	ret = devm_pm_runtime_enable(mdev->dev);
+	if (ret)
+		return ret;
 
 	ret = pm_runtime_resume_and_get(mdev->dev);
 	if (ret < 0)
Signature · 1 line
2.50.1.windows.1