]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
reset: renesas: Fix Runtime PM usage
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 15 Dec 2021 10:14:23 +0000 (11:14 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 21 Jan 2022 14:49:31 +0000 (15:49 +0100)
commit4ae3a50df866262b9097af82cb2a867b77abaca3
treeb042b7acaabdcf21e8691812b49567c3e931a6cd
parente82c3a228639ea13d623d854f85cfa4a65e39f5f
reset: renesas: Fix Runtime PM usage

BugLink: https://bugs.launchpad.net/bugs/1957882
commit 92c959bae2e54ba1e2540ba5f813f7752bd76be1 upstream.

If pm_runtime_resume_and_get() fails then it returns w/o the RPM usage
counter being incremented. In this case call pm_runtime_put() in
remove() will result in a usage counter imbalance. Therefore check the
return code of pm_runtime_resume_and_get() and bail out in case of error.

Fixes: bee08559701f ("reset: renesas: Add RZ/G2L usbphy control driver")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/ec24e13f-0530-b091-7a08-864577b9b3be@gmail.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
drivers/reset/reset-rzg2l-usbphy-ctrl.c