RE: [PATCH] usb: host: ehci-tegra: Fix oops in error cleanup

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

 



> -----Original Message-----
> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Thierry Reding
> Sent: Wednesday, April 03, 2013 2:11 AM
> To: Felipe Balbi
> Cc: Stephen Warren; Alan Stern; linux-tegra@xxxxxxxxxxxxxxx; linux-
> usb@xxxxxxxxxxxxxxx
> Subject: [PATCH] usb: host: ehci-tegra: Fix oops in error cleanup
> 
> The cleanup path checks whether the transceiver was properly initialized
> using IS_ERR(). However it can also happen that the cleanup path is run
> before the transceiver was initialized (or the operating mode isn't set
> to TEGRA_USB_OTG) and is therefore NULL. Add a separate label for error
> unwinding and initialize the transceiver field to ERR_PTR(-ENODEV) when
> the operating mode isn't TEGRA_USB_OTG to allow for consistent checking.

This change looks good to me.
Acked-by: Venu Byravarasu <vbyravarasu@xxxxxxxxxx>

> 
> Signed-off-by: Thierry Reding <thierry@xxxxxxxx>
> ---
>  drivers/usb/host/ehci-tegra.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
> index 1d2488c..c8cb488 100644
> --- a/drivers/usb/host/ehci-tegra.c
> +++ b/drivers/usb/host/ehci-tegra.c
> @@ -755,7 +755,7 @@ static int tegra_ehci_probe(struct platform_device
> *pdev)
>  	err = usb_phy_set_suspend(hcd->phy, 0);
>  	if (err) {
>  		dev_err(&pdev->dev, "Failed to power on the phy\n");
> -		goto fail;
> +		goto fail_phy;
>  	}
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux