From: Kishon Vijay Abraham I Date: Mon, 2 Jul 2012 06:50:24 +0000 (+0530) Subject: usb: phy: fix error handling in usb_get_phy X-Git-Tag: v3.6-rc1~101^2~24^2~33^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8ecf829481b2cc7301a811da9d2df53ef174977;p=platform%2Fkernel%2Flinux-exynos.git usb: phy: fix error handling in usb_get_phy spin_unlock_irqrestore() was not being called in the error path of usb_get_phy. It's fixed here. Reported-by: Marc Kleine-Budde Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index 88d62b1..1bf60a2 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c @@ -98,11 +98,12 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) if (IS_ERR(phy)) { pr_err("unable to find transceiver of type %s\n", usb_phy_type_string(type)); - return phy; + goto err0; } get_device(phy->dev); +err0: spin_unlock_irqrestore(&phy_lock, flags); return phy;