Re: [PATCH usb-next v1] usb: core: phy: fix return value of usb_phy_roothub_exit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2018-03-24 at 14:56 +0100, Martin Blumenstingl wrote:
> 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.
> Fix this by assigning the error code from phy_exit() to the "ret"
> variable to propagate the error correctly.
> 
> Fixes: 07dbff0ddbd86c ("usb: core: add a wrapper for the USB PHYs on the HCD")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/phy.c b/drivers/usb/core/phy.c
> index 09b7c43c0ea4..f19aaa3c899c 100644
> --- a/drivers/usb/core/phy.c
> +++ b/drivers/usb/core/phy.c
> @@ -111,7 +111,7 @@ int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub)
>  	list_for_each_entry(roothub_entry, head, list) {
>  		err = phy_exit(roothub_entry->phy);
>  		if (err)
> -			ret = ret;
> +			ret = err;
Need break the loop?
>  	}
>  
>  	return ret;


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux