All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
@ 2015-01-09 23:16 Alexey Khoroshilov
  2015-01-12 12:37 ` Oliver Neukum
  2015-01-12 21:43 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Khoroshilov @ 2015-01-09 23:16 UTC (permalink / raw)
  To: David S. Miller
  Cc: Alexey Khoroshilov, linux-usb, netdev, linux-kernel, ldv-project

Commit e4c7f259c5be ("USB: kaweth.c: use GFP_ATOMIC under spin_lock")
makes sure that kaweth_internal_control_msg() allocates memory with GFP_ATOMIC,
but kaweth_internal_control_msg() also calls usb_start_wait_urb()
that still allocates memory with GFP_NOIO.

The patch fixes usb_start_wait_urb() as well.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/net/usb/kaweth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index dcb6d33141e0..1e9cdca37014 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1276,7 +1276,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
         awd.done = 0;
 
         urb->context = &awd;
-        status = usb_submit_urb(urb, GFP_NOIO);
+        status = usb_submit_urb(urb, GFP_ATOMIC);
         if (status) {
                 // something went wrong
                 usb_free_urb(urb);
-- 
1.9.1


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

* Re: [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
  2015-01-09 23:16 [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb() Alexey Khoroshilov
@ 2015-01-12 12:37 ` Oliver Neukum
  2015-01-12 21:43 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Oliver Neukum @ 2015-01-12 12:37 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: David S. Miller, linux-usb, netdev, linux-kernel, ldv-project

On Sat, 2015-01-10 at 02:16 +0300, Alexey Khoroshilov wrote:
> Commit e4c7f259c5be ("USB: kaweth.c: use GFP_ATOMIC under spin_lock")
> makes sure that kaweth_internal_control_msg() allocates memory with
> GFP_ATOMIC,
> but kaweth_internal_control_msg() also calls usb_start_wait_urb()
> that still allocates memory with GFP_NOIO.
> 
> The patch fixes usb_start_wait_urb() as well.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Acked-by: Oliver Neukum <oliver@neukum.org>


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

* Re: [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
  2015-01-09 23:16 [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb() Alexey Khoroshilov
  2015-01-12 12:37 ` Oliver Neukum
@ 2015-01-12 21:43 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-01-12 21:43 UTC (permalink / raw)
  To: khoroshilov; +Cc: linux-usb, netdev, linux-kernel, ldv-project

From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Sat, 10 Jan 2015 02:16:22 +0300

> Commit e4c7f259c5be ("USB: kaweth.c: use GFP_ATOMIC under spin_lock")
> makes sure that kaweth_internal_control_msg() allocates memory with GFP_ATOMIC,
> but kaweth_internal_control_msg() also calls usb_start_wait_urb()
> that still allocates memory with GFP_NOIO.
> 
> The patch fixes usb_start_wait_urb() as well.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Applied, thanks.

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

end of thread, other threads:[~2015-01-12 21:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-09 23:16 [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb() Alexey Khoroshilov
2015-01-12 12:37 ` Oliver Neukum
2015-01-12 21:43 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.