Skip to content

Commit 3bd4edd

Browse files
ISCAS-Vulabkhilman
authored andcommitted
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: 25f7d74 ("hwspinlock: omap: Use devm_pm_runtime_enable() helper") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20251124104805.135-1-vulab@iscas.ac.cn Signed-off-by: Kevin Hilman <khilman@baylibre.com>
1 parent 5e2d6fa commit 3bd4edd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/hwspinlock/omap_hwspinlock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
8888
* make sure the module is enabled and clocked before reading
8989
* the module SYSSTATUS register
9090
*/
91-
devm_pm_runtime_enable(&pdev->dev);
91+
ret = devm_pm_runtime_enable(&pdev->dev);
92+
if (ret)
93+
return ret;
9294
ret = pm_runtime_resume_and_get(&pdev->dev);
9395
if (ret < 0)
9496
return ret;

0 commit comments

Comments
 (0)