Skip to content

Commit

Permalink
can: ucan: fix non-atomic allocation in completion handler
Browse files Browse the repository at this point in the history
USB completion handlers are called in atomic context and must
specifically not allocate memory using GFP_KERNEL.

Fixes: 9f2d3ea ("can: ucan: add driver for Theobroma Systems UCAN devices")
Cc: stable <stable@vger.kernel.org>     # 4.19
Cc: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Cc: Martin Elshuber <martin.elshuber@theobroma-systems.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Johan Hovold authored and Marc Kleine-Budde committed Dec 3, 2019
1 parent 9ebd796 commit 870db5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/usb/ucan.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ static void ucan_read_bulk_callback(struct urb *urb)
up);

usb_anchor_urb(urb, &up->rx_urbs);
ret = usb_submit_urb(urb, GFP_KERNEL);
ret = usb_submit_urb(urb, GFP_ATOMIC);

if (ret < 0) {
netdev_err(up->netdev,
Expand Down

0 comments on commit 870db5d

Please sign in to comment.