Re: [PATCH can-next 05/10] can: gs_usb: gs_usb_receive_bulk_callback(): check for overflow flag if SKB allocation fails
From: netdev-bot+sashiko
Date: Mon Oct 05 2026 - 08:16:52 EST
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit "can: gs_usb: gs_usb_receive_bulk_callback(): check
for overflow flag if SKB allocation fails" fixes a real bug but has no…
--
can: gs_usb: gs_usb_receive_bulk_callback(): check for overflow flag if SKB allocation fails
When SKB allocation fails in gs_usb_receive_bulk_callback(), this patch
jumps to a new check_overflow label instead of jumping straight to
resubmit_urb. As a result, the GS_CAN_FLAG_OVERFLOW handling still runs
when alloc_canfd_skb() or alloc_can_skb() fails.
> diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
> index 0a9c490c0c445..f40f825b7eb29 100644
> --- a/drivers/net/can/usb/gs_usb.c
> +++ b/drivers/net/can/usb/gs_usb.c
[ ... ]
> @@ -712,6 +712,7 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
> netif_wake_queue(netdev);
> }
>
> +check_overflow:
> if (hf->flags & GS_CAN_FLAG_OVERFLOW) {
> stats->rx_over_errors++;
> stats->rx_errors++;
[Severity: Low]
Should this commit have Fixes: tags and a Cc: stable?
Before this change, gs_usb_receive_bulk_callback() skipped the
GS_CAN_FLAG_OVERFLOW block whenever alloc_canfd_skb() or alloc_can_skb()
failed. In that case:
- rx_over_errors and rx_errors were not incremented
- no CAN_ERR_CRTL_RX_OVERFLOW error frame was attempted
For classic CAN frames, the missed check goes back to the original driver.
For the FD branch, it goes back to the CAN-FD support:
d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
26949ac935e3 ("can: gs_usb: add CAN-FD support")
An earlier fix to these same lines has both of those Fixes: tags and
Cc: stable@xxxxxxxxxx:
68c5724ecd15 ("can: gs_usb: gs_usb_receive_bulk_callback(): resubmit URB
on skb allocation failure")
Without matching tags here, stable trees that took 68c5724ecd15 would not
automatically get this follow-up fix for the overflow accounting.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261004-gs_usb-cleanups-and-fixes-v1-0-7b4b06244a77%40pengutronix.de