linux/drivers/net/can
Marc Kleine-Budde 54950747d5 can: gs_usb: gs_can_open(): improve error handling
commit 2603be9e81 upstream.

The gs_usb driver handles USB devices with more than 1 CAN channel.
The RX path for all channels share the same bulk endpoint (the
transmitted bulk data encodes the channel number). These per-device
resources are allocated and submitted by the first opened channel.

During this allocation, the resources are either released immediately
in case of a failure or the URBs are anchored. All anchored URBs are
finally killed with gs_usb_disconnect().

Currently, gs_can_open() returns with an error if the allocation of a
URB or a buffer fails. However, if usb_submit_urb() fails, the driver
continues with the URBs submitted so far, even if no URBs were
successfully submitted.

Treat every error as fatal and free all allocated resources
immediately.

Switch to goto-style error handling, to prepare the driver for more
per-device resource allocation.

Cc: stable@vger.kernel.org
Cc: John Whittington <git@jbrengineering.co.uk>
Link: https://lore.kernel.org/all/20230716-gs_usb-fix-time-stamp-counter-v1-1-9017cefcd9d5@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:50:27 +02:00
..
c_can
cc770
ctucanfd
dev can: dev: fix missing CAN XL support in can_put_echo_skb() 2023-05-24 17:32:46 +01:00
flexcan
ifi_canfd
m_can can: tcan4x5x: Fix use of register error status mask 2022-12-31 13:32:27 +01:00
mscan
peak_canfd
rcar can: rcar_canfd: Fix R-Car V3U GAFLCFG field accesses 2023-03-10 09:32:58 +01:00
sja1000
slcan
softing
spi can: mcp251xfd: __mcp251xfd_chip_set_mode(): increase poll timeout 2023-07-27 08:50:27 +02:00
usb can: gs_usb: gs_can_open(): improve error handling 2023-07-27 08:50:27 +02:00
at91_can.c
can327.c can: can327: flush TX_work on ldisc .close() 2022-12-07 10:32:36 +01:00
grcan.c
janz-ican3.c
Kconfig
kvaser_pciefd.c can: kvaser_pciefd: Set hardware timestamp on transmitted packets 2023-07-19 16:21:11 +02:00
Makefile
pch_can.c
sun4i_can.c
ti_hecc.c
vcan.c
vxcan.c
xilinx_can.c