[PATCH 20/20] usb: host: xhci: free priv outside of locked region

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

 



In case we have any errors, we can free_priv with locks released and
interrupts enabled.

Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
---
 drivers/usb/host/xhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 0fab051f06fc..32aef7c9a677 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1376,12 +1376,13 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
 		ret = xhci_queue_isoc_tx(xhci, GFP_ATOMIC, urb,
 				slot_id, ep_index);
 	}
+	spin_unlock_irqrestore(&xhci->lock, flags);
 
 	if (ret) {
 		xhci_urb_free_priv(urb_priv);
 		urb->hcpriv = NULL;
 	}
-	spin_unlock_irqrestore(&xhci->lock, flags);
+
 	return ret;
 }
 
-- 
2.16.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