[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251124104805.135-1-vulab@iscas.ac.cn>
Date: Mon, 24 Nov 2025 18:48:05 +0800
From: Haotian Zhang <vulab@...as.ac.cn>
To: andersson@...nel.org
Cc: baolin.wang@...ux.alibaba.com,
linux-omap@...r.kernel.org,
linux-remoteproc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Haotian Zhang <vulab@...as.ac.cn>
Subject: [PATCH] hwspinlock: 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: 25f7d74d4514 ("hwspinlock: omap: Use devm_pm_runtime_enable() helper")
Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
---
drivers/hwspinlock/omap_hwspinlock.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index 27b47b8623c0..2d8de835bc24 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -88,7 +88,9 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
* make sure the module is enabled and clocked before reading
* the module SYSSTATUS register
*/
- devm_pm_runtime_enable(&pdev->dev);
+ ret = devm_pm_runtime_enable(&pdev->dev);
+ if (ret)
+ return ret;
ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret < 0)
return ret;
--
2.50.1.windows.1
Powered by blists - more mailing lists