An URB memory leak [1][2] was recently fixed in the gs_usb driver. The
driver did not take into account that completed URBs are no longer
anchored, causing them to be lost during ifdown. The memory leak was fixed
by re-anchoring the URBs in the URB completion callback.
Several USB CAN drivers are affected by the same error. Fix them
accordingly.
[1] https://lore.kernel.org/all/20260109135311.576033-3-mkl@pengutronix.de/
[2] https://lore.kernel.org/all/20260116-can_usb-fix-reanchor-v1-1-9d74e7289225@pengutronix.de/
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes in v2:
- removed Remigiusz Kołłątaj from list of recipients
(their email address is no longer valid)
- rebased to latest net/main
- all: add review feedback, unanchor in case of error
https://lore.kernel.org/all/20260110223836.3890248-1-kuba@kernel.org/
- Link to v1: https://patch.msgid.link/20260110-can_usb-fix-memory-leak-v1-0-4a7c082a7081@pengutronix.de
---
Marc Kleine-Budde (5):
can: ems_usb: ems_usb_read_bulk_callback(): fix URB memory leak
can: esd_usb: esd_usb_read_bulk_callback(): fix URB memory leak
can: kvaser_usb: kvaser_usb_read_bulk_callback(): fix URB memory leak
can: mcba_usb: mcba_usb_read_bulk_callback(): fix URB memory leak
can: usb_8dev: usb_8dev_read_bulk_callback(): fix URB memory leak
drivers/net/can/usb/ems_usb.c | 8 +++++++-
drivers/net/can/usb/esd_usb.c | 9 ++++++++-
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 9 ++++++++-
drivers/net/can/usb/mcba_usb.c | 8 +++++++-
drivers/net/can/usb/usb_8dev.c | 8 +++++++-
5 files changed, 37 insertions(+), 5 deletions(-)
---
base-commit: a74c7a58ca2ca1cbb93f4c01421cf24b8642b962
change-id: 20260109-can_usb-fix-memory-leak-0d769e002393
Best regards,
--
Marc Kleine-Budde <mkl@pengutronix.de>