Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Marc Kleine-Budde
Mon, 30 Nov 2026 09:15
[PATCH net-next 9/9] can: gs_usb: gs_usb_receive_bulk_callback(): emit error message on invalid channel instead of disconnecting...
Author: Marc Kleine-Budde
Date: Mon, 30 Nov 2026 09:15
Date: Mon, 30 Nov 2026 09:15
41 lines
11222 bytes
11222 bytes
If the USB device sends an invalid channel, consider this a firmware glitch
and don't detach all network interfaces of the USB device silently.
Instead, display an error message and resubmit the URB.
Link: https://patch.msgid.link/20261130-gs_usb-fixes-v12-9-9ba1f84c179a@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/usb/gs_usb.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index 10769296c6e0..ba9af90036b8 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -666,8 +666,13 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
}
/* device reports out of range channel id */
- if (hf->channel >= parent->channel_cnt)
- goto device_detach;
+ if (hf->channel >= parent->channel_cnt) {
+ dev_err_ratelimited(&parent->udev->dev,
+ "channel number out of range (channel=%u, channel_cnt=%u)\n",
+ hf->channel, parent->channel_cnt);
+
+ goto resubmit_urb;
+ }
dev = parent->canch[hf->channel];
@@ -792,7 +797,6 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
/* USB failure take down all interfaces */
if (rc == -ENODEV) {
-device_detach:
for (rc = 0; rc < parent->channel_cnt; rc++) {
if (parent->canch[rc])
netif_device_detach(parent->canch[rc]->netdev);
--
2.53.0
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads