There are 2 BUG_ON() in the CAN dev helpers. During the update/test of the at91_can driver to rx-offload the one in can_restart() was triggered, due to a race condition in can_restart() and a hardware limitation of the at91_can IP core. This series fixes the race condition, replaces BUG_ON() with an error message, and does some cleanup. Finally, the BUG_ON() in can_put_echo_skb() is also replaced with error handling. Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> --- Marc Kleine-Budde (5): can: dev: can_restart(): don't crash kernel if carrier is OK can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() can: dev: can_restart(): reverse logic to remove need for goto can: dev: can_restart(): update debug and error messages can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds drivers/net/can/dev/dev.c | 25 ++++++++++++------------- drivers/net/can/dev/skb.c | 6 +++++- 2 files changed, 17 insertions(+), 14 deletions(-) --- base-commit: 473267a4911f2469722c74ca58087d951072f72a change-id: 20231004-can-dev-fix-can-restart-eef8ba3e5e6e Best regards, -- Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>