Skip to contentSkip to conversation

USB: kaweth.c: use GFP_ATOMIC under spin_lock

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 27, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: kaweth.c: use GFP_ATOMIC under spin_lock

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.

---
Applies to Linus's tree.

drivers/net/usb/kaweth.c +1 -1
index d8ad552..c3d0349 100644
@@ -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;
 
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Fri, 27 Jul 2012 14:46:51 +0300

Quoted 11 lines

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.

Applied.