diff mbox

drivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()

Message ID 1306775184-5520-1-git-send-email-khoroshilov@ispras.ru
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Alexey Khoroshilov May 30, 2011, 5:06 p.m. UTC
Sorry, I missed a description in the previous mail.


catc_ctrl_run() calls usb_submit_urb() with GFP_KERNEL, while it is called from
catc_ctrl_async() and catc_ctrl_done() with catc->ctrl_lock spinlock held.

The patch replaces GFP_KERNEL with GFP_ATOMIC.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/net/usb/catc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller May 31, 2011, 10:30 p.m. UTC | #1
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Mon, 30 May 2011 21:06:24 +0400

> catc_ctrl_run() calls usb_submit_urb() with GFP_KERNEL, while it is called from
> catc_ctrl_async() and catc_ctrl_done() with catc->ctrl_lock spinlock held.
> 
> The patch replaces GFP_KERNEL with GFP_ATOMIC.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index d7221c4..8056f8a 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -495,7 +495,7 @@  static void catc_ctrl_run(struct catc *catc)
 	if (!q->dir && q->buf && q->len)
 		memcpy(catc->ctrl_buf, q->buf, q->len);
 
-	if ((status = usb_submit_urb(catc->ctrl_urb, GFP_KERNEL)))
+	if ((status = usb_submit_urb(catc->ctrl_urb, GFP_ATOMIC)))
 		err("submit(ctrl_urb) status %d", status);
 }