Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

can: usb: etas_es58x: correctly anchor the urb in the read bulk callback

When submitting an urb, that is using the anchor pattern, it needs to be
anchored before submitting it otherwise it could be leaked if
usb_kill_anchored_urbs() is called. This logic is correctly done
elsewhere in the driver, except in the read bulk callback so do that
here also.

Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Tested-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/2026022320-poser-stiffly-9d84@gregkh
Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Greg Kroah-Hartman and committed by
Marc Kleine-Budde
5eaad4f7 1e446fd0

+7 -1
+7 -1
drivers/net/can/usb/etas_es58x/es58x_core.c
··· 1461 1461 } 1462 1462 1463 1463 resubmit_urb: 1464 + usb_anchor_urb(urb, &es58x_dev->rx_urbs); 1464 1465 ret = usb_submit_urb(urb, GFP_ATOMIC); 1466 + if (!ret) 1467 + return; 1468 + 1469 + usb_unanchor_urb(urb); 1470 + 1465 1471 if (ret == -ENODEV) { 1466 1472 for (i = 0; i < es58x_dev->num_can_ch; i++) 1467 1473 if (es58x_dev->netdev[i]) 1468 1474 netif_device_detach(es58x_dev->netdev[i]); 1469 - } else if (ret) 1475 + } else 1470 1476 dev_err_ratelimited(dev, 1471 1477 "Failed resubmitting read bulk urb: %pe\n", 1472 1478 ERR_PTR(ret));