]> git.ipfire.org Git - thirdparty/linux.git/commit
phy: ti: da8xx-usb: Handle devm_pm_runtime_enable() errors
authorHaotian Zhang <vulab@iscas.ac.cn>
Mon, 24 Nov 2025 10:57:34 +0000 (18:57 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 23 Dec 2025 16:30:51 +0000 (22:00 +0530)
commit08aa19de72110df8ac10c9e67349dd884eeed41d
tree8ee5616601c392f587d377c17bf1e4116b1db0d3
parentcabd25b57216ddc132efbcc31f972baa03aad15a
phy: ti: da8xx-usb: Handle devm_pm_runtime_enable() errors

devm_pm_runtime_enable() can fail due to memory allocation. The current
code ignores its return value after calling pm_runtime_set_active(),
leaving the device in an inconsistent state if runtime PM initialization
fails.

Check the return value of devm_pm_runtime_enable() and return on
failure. Also move the declaration of 'ret' to the function scope
to support this check.

Fixes: ee8e41b5044f ("phy: ti: phy-da8xx-usb: Add runtime PM support")
Suggested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251124105734.1027-1-vulab@iscas.ac.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/ti/phy-da8xx-usb.c