All of lore.kernel.org
 help / color / mirror / Atom feed
* [20/20] usb: host: xhci: free priv outside of locked region
@ 2018-04-16 12:29 Felipe Balbi
  0 siblings, 0 replies; only message in thread
From: Felipe Balbi @ 2018-04-16 12:29 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Linux USB, Felipe Balbi

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

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
---
 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;
 }
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-16 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 12:29 [20/20] usb: host: xhci: free priv outside of locked region Felipe Balbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.