netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] USB: kaweth.c: use GFP_ATOMIC under spin_lock
@ 2012-07-27 11:46 Dan Carpenter
  2012-07-27 20:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-07-27 11:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, netdev, kernel-janitors

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>
---
Applies to Linus's tree.

diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index d8ad552..c3d0349 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -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;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] USB: kaweth.c: use GFP_ATOMIC under spin_lock
  2012-07-27 11:46 [patch] USB: kaweth.c: use GFP_ATOMIC under spin_lock Dan Carpenter
@ 2012-07-27 20:46 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-07-27 20:46 UTC (permalink / raw)
  To: dan.carpenter; +Cc: gregkh, linux-usb, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 27 Jul 2012 14:46:51 +0300

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-27 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27 11:46 [patch] USB: kaweth.c: use GFP_ATOMIC under spin_lock Dan Carpenter
2012-07-27 20:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).