From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Linux USB <linux-usb@vger.kernel.org>,
Felipe Balbi <felipe.balbi@linux.intel.com>
Subject: [20/20] usb: host: xhci: free priv outside of locked region
Date: Mon, 16 Apr 2018 15:29:30 +0300 [thread overview]
Message-ID: <20180416122930.15697-20-felipe.balbi@linux.intel.com> (raw)
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;
}
reply other threads:[~2018-04-16 12:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416122930.15697-20-felipe.balbi@linux.intel.com \
--to=felipe.balbi@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.