[PATCH] usb: host: max3421-hcd: Fix missing unlock in max3421_urb_enqueue()

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

 



From: David Mosberger-Tang <davidm@xxxxxxxxxx>

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: David Mosberger <davidm@xxxxxxxxxx>
---
 drivers/usb/host/max3421-hcd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 28abda1..714f99f 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1545,8 +1545,10 @@ max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 	if (!max3421_ep) {
 		/* gets freed in max3421_endpoint_disable: */
 		max3421_ep = kzalloc(sizeof(struct max3421_ep), mem_flags);
-		if (!max3421_ep)
-			return -ENOMEM;
+		if (!max3421_ep) {
+			retval = -ENOMEM;
+			goto out;
+		}
 		max3421_ep->ep = urb->ep;
 		max3421_ep->last_active = max3421_hcd->frame_number;
 		urb->ep->hcpriv = max3421_ep;
@@ -1561,6 +1563,7 @@ max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 		wake_up_process(max3421_hcd->spi_thread);
 	}
 
+out:
 	spin_unlock_irqrestore(&max3421_hcd->lock, flags);
 	return retval;
 }
-- 
1.9.1

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