[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191128182603.22004-1-johan@kernel.org>
Date: Thu, 28 Nov 2019 19:26:03 +0100
From: Johan Hovold <johan@...nel.org>
To: Wolfgang Grandegger <wg@...ndegger.com>,
Marc Kleine-Budde <mkl@...gutronix.de>
Cc: linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Johan Hovold <johan@...nel.org>,
stable <stable@...r.kernel.org>,
Jakob Unterwurzacher <jakob.unterwurzacher@...obroma-systems.com>,
Martin Elshuber <martin.elshuber@...obroma-systems.com>,
Philipp Tomsich <philipp.tomsich@...obroma-systems.com>
Subject: [PATCH] can: ucan: fix non-atomic allocation in completion handler
USB completion handlers are called in atomic context and must
specifically not allocate memory using GFP_KERNEL.
Fixes: 9f2d3eae88d2 ("can: ucan: add driver for Theobroma Systems UCAN devices")
Cc: stable <stable@...r.kernel.org> # 4.19
Cc: Jakob Unterwurzacher <jakob.unterwurzacher@...obroma-systems.com>
Cc: Martin Elshuber <martin.elshuber@...obroma-systems.com>
Cc: Philipp Tomsich <philipp.tomsich@...obroma-systems.com>
Signed-off-by: Johan Hovold <johan@...nel.org>
---
drivers/net/can/usb/ucan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/ucan.c b/drivers/net/can/usb/ucan.c
index 04aac3bb54ef..81e942f713e6 100644
--- a/drivers/net/can/usb/ucan.c
+++ b/drivers/net/can/usb/ucan.c
@@ -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,
--
2.24.0
Powered by blists - more mailing lists