usb: host: ehci-tegra: Fix oops in error cleanup
authorThierry Reding <thierry@gilfi.de>
Wed, 3 Apr 2013 19:57:57 +0000 (21:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2013 20:33:55 +0000 (13:33 -0700)
commit369a9a9d2af702bac3ccd2ade86ddcb2594eb3b1
treeaa49afe27f16a38a04be29cbb71ef98115d995af
parenteb5369edca4f4307a6035dc6f6813698b0762906
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.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-tegra.c