USB: xhci: Use GFP_ATOMIC while holding spinlocks.
[deliverable/linux.git] / drivers / usb / host / xhci-hcd.c
index 1c5901ad6eb8446f2adac830dc930589af839be9..ff99365cae4273b28d544767eeeeed2fa307c082 100644 (file)
@@ -601,10 +601,13 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
                goto exit;
        }
        if (usb_endpoint_xfer_control(&urb->ep->desc))
-               ret = xhci_queue_ctrl_tx(xhci, mem_flags, urb,
+               /* We have a spinlock and interrupts disabled, so we must pass
+                * atomic context to this function, which may allocate memory.
+                */
+               ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb,
                                slot_id, ep_index);
        else if (usb_endpoint_xfer_bulk(&urb->ep->desc))
-               ret = xhci_queue_bulk_tx(xhci, mem_flags, urb,
+               ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb,
                                slot_id, ep_index);
        else
                ret = -EINVAL;
This page took 0.036104 seconds and 5 git commands to generate.