[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251123161935.1738-1-vulab@iscas.ac.cn>
Date: Mon, 24 Nov 2025 00:19:35 +0800
From: Haotian Zhang <vulab@...as.ac.cn>
To: jassisinghbrar@...il.com
Cc: afd@...com,
linux-kernel@...r.kernel.org,
Haotian Zhang <vulab@...as.ac.cn>
Subject: [PATCH] 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")
Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
---
drivers/mailbox/omap-mailbox.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index 680243751d62..e4fb8ffdde37 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -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)
--
2.50.1.windows.1
Powered by blists - more mailing lists