[PATCH] drivers: usb: otg: fix error handling in usb_get_phy

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

 



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@xxxxxxxxxxxxxx>
Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx>
---
 drivers/usb/otg/otg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index 0fa4d8c..5c4ec51 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;
-- 
1.7.5.4

--
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