Skip to content

Commit 60c016a

Browse files
tititiou36Andi Shyti
authored andcommitted
i2c: omap: Fix an error handling path in omap_i2c_probe()
If an error occurs after pm_runtime_use_autosuspend(), a corresponding pm_runtime_dont_use_autosuspend() should be called. In case of error in pm_runtime_resume_and_get(), it is not the case because the error handling path is wrongly ordered. Fix it. Fixes: 780f629 ("i2c: omap: fix reference leak when pm_runtime_get_sync fails") Signed-off-by: Christophe JAILLET <[email protected]> Cc: <[email protected]> # v5.13+ Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/af8a9b62996bebbaaa7c02986aa2a8325ef11596.1751701715.git.christophe.jaillet@wanadoo.fr
1 parent a9503a2 commit 60c016a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,9 +1521,9 @@ omap_i2c_probe(struct platform_device *pdev)
15211521
if (omap->mux_state)
15221522
mux_state_deselect(omap->mux_state);
15231523
err_put_pm:
1524-
pm_runtime_dont_use_autosuspend(omap->dev);
15251524
pm_runtime_put_sync(omap->dev);
15261525
err_disable_pm:
1526+
pm_runtime_dont_use_autosuspend(omap->dev);
15271527
pm_runtime_disable(&pdev->dev);
15281528

15291529
return r;

0 commit comments

Comments
 (0)