mailbox: omap: Handle devm_pm_runtime_enable() errors
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 ofdevm_pm_runtime_enable() and return on failure.
Fixes e4e8b1fe742f ("mailbox: omap: Use devm_pm_runtime_enable() helper")
Signed-off-by Haotian Zhang <[email protected]>
--- drivers/mailbox/omap-mailbox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mailbox/omap-mailbox.c +3 -1
@@ -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