USB: kaweth.c: use GFP_ATOMIC under spin_lock
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 27 Jul 2012 01:46:51 +0000 (01:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jul 2012 20:45:50 +0000 (13:45 -0700)
The problem is that we call this with a spin lock held.  The call tree
is:
kaweth_start_xmit() holds kaweth->device_lock.
-> kaweth_async_set_rx_mode()
   -> kaweth_control()
      -> kaweth_internal_control_msg()

The kaweth_internal_control_msg() function is only called from
kaweth_control() which used GFP_ATOMIC for its allocations.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/kaweth.c

index d8ad552843893c357e5b509b3b60daf2310217fb..c3d03490c97d04c4724b472bade7f1b6bc9bba0d 100644 (file)
@@ -1314,7 +1314,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
         int retv;
         int length = 0; /* shut up GCC */
 
-        urb = usb_alloc_urb(0, GFP_NOIO);
+       urb = usb_alloc_urb(0, GFP_ATOMIC);
         if (!urb)
                 return -ENOMEM;