usb: gadget: amd5536udc: unconditionally use GFP_ATOMIC in udc_queue()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Thu, 1 Aug 2013 19:50:47 +0000 (23:50 +0400)
committerFelipe Balbi <balbi@ti.com>
Fri, 9 Aug 2013 13:33:31 +0000 (16:33 +0300)
As far as prep_dma() is called with spinlock held,
we have to pass GFP_ATOMIC regardless of gfp argument.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/amd5536udc.c

index f52dcfe8f545077df80aca9cb97f1ec2e72b6261..a9a4346c83aae221776a297eff8330aab6bb733c 100644 (file)
@@ -1122,7 +1122,7 @@ udc_queue(struct usb_ep *usbep, struct usb_request *usbreq, gfp_t gfp)
                        goto finished;
                }
                if (ep->dma) {
-                       retval = prep_dma(ep, req, gfp);
+                       retval = prep_dma(ep, req, GFP_ATOMIC);
                        if (retval != 0)
                                goto finished;
                        /* write desc pointer to enable DMA */
@@ -1190,7 +1190,7 @@ udc_queue(struct usb_ep *usbep, struct usb_request *usbreq, gfp_t gfp)
                 * for PPB modes, because of chain creation reasons
                 */
                if (ep->in) {
-                       retval = prep_dma(ep, req, gfp);
+                       retval = prep_dma(ep, req, GFP_ATOMIC);
                        if (retval != 0)
                                goto finished;
                }