Skip to content
Commit dd40438f authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Greg Kroah-Hartman
Browse files

usb: core: phy: fix return value of usb_phy_roothub_exit()



usb_phy_roothub_exit() should return the error code from the phy_exit()
call if exiting the PHY failed.
However, since a wrong variable is used usb_phy_roothub_exit() currently
always returns 0, even if one of the phy_exit calls returned an error.
Clang also reports this bug:
kernel/drivers/usb/core/phy.c:114:8: warning: explicitly assigning value of
variable of type 'int' to itself [-Wself-assign] error, forbidden
warning: phy.c:114

Fix this by assigning the error code from phy_exit() to the "ret"
variable to propagate the error correctly.

Fixes: 07dbff0d ("usb: core: add a wrapper for the USB PHYs on the HCD")
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: default avatarRishabh Bhatnagar <rishabhb@codeaurora.org>
Tested-by: default avatarKeerthy <j-keerthy@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b1b59e16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment