Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42bd3e78 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

can: ucan: fix non-atomic allocation in completion handler



commit 870db5d1015c8bd63e93b579e857223c96249ff7 upstream.

USB completion handlers are called in atomic context and must
specifically not allocate memory using GFP_KERNEL.

Fixes: 9f2d3eae ("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: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 59101399
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -796,7 +796,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,