usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Thu, 19 Jun 2014 19:44:57 +0000 (23:44 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 23:06:50 +0000 (16:06 -0700)
As far as kzalloc() is called with spinlock held,
we have to pass GFP_ATOMIC regardless of mem_flags argument.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/max3421-hcd.c

index 6dbf1e9c137c9403212fb6a070fbbe5f108dd156..6234c75da33fa3a3d50f1ef173b9c5a7a7db9ca5 100644 (file)
@@ -1547,7 +1547,7 @@ max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
        max3421_ep = urb->ep->hcpriv;
        if (!max3421_ep) {
                /* gets freed in max3421_endpoint_disable: */
-               max3421_ep = kzalloc(sizeof(struct max3421_ep), mem_flags);
+               max3421_ep = kzalloc(sizeof(struct max3421_ep), GFP_ATOMIC);
                if (!max3421_ep) {
                        retval = -ENOMEM;
                        goto out;