Skip to content

Commit

Permalink
drivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexey Khoroshilov authored and David S. Miller committed May 31, 2011
1 parent a000c01 commit 930a6ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/usb/catc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 930a6ea

Please sign in to comment.