Skip to content

Commit

Permalink
usb: phy: fix error handling in usb_get_phy
Browse files Browse the repository at this point in the history
spin_unlock_irqrestore() was not being called in the error path of
usb_get_phy. It's fixed here.

Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Kishon Vijay Abraham I authored and Felipe Balbi committed Jul 2, 2012
1 parent ded017e commit f8ecf82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/otg/otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f8ecf82

Please sign in to comment.