linux-sg2042/drivers/net/can
Pavel Skripkin 928150fad4 can: esd_usb2: fix memory leak
In esd_usb2_setup_rx_urbs() MAX_RX_URBS coherent buffers are allocated
and there is nothing, that frees them:

1) In callback function the urb is resubmitted and that's all
2) In disconnect function urbs are simply killed, but URB_FREE_BUFFER
   is not set (see esd_usb2_setup_rx_urbs) and this flag cannot be used
   with coherent buffers.

So, all allocated buffers should be freed with usb_free_coherent()
explicitly.

Side note: This code looks like a copy-paste of other can drivers. The
same patch was applied to mcba_usb driver and it works nice with real
hardware. There is no change in functionality, only clean-up code for
coherent buffers.

Fixes: 96d8e90382 ("can: Add driver for esd CAN-USB/2 device")
Link: https://lore.kernel.org/r/b31b096926dcb35998ad0271aac4b51770ca7cc8.1627404470.git.paskripkin@gmail.com
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-07-30 08:47:34 +02:00
..
c_can can: c_can: add ethtool support 2021-05-27 09:42:23 +02:00
cc770 can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
dev can: skb: alloc_can{,fd}_skb(): set "cf" to NULL if skb allocation fails 2021-04-07 09:31:19 +02:00
ifi_canfd can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
m_can can: m_can: fix whitespace in a few comments 2021-05-27 09:42:24 +02:00
mscan can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
peak_canfd can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path 2021-06-24 08:40:10 +02:00
rcar can: dev: can_free_echo_skb(): extend to return can frame length 2021-03-30 11:14:28 +02:00
sja1000 can: dev: can_free_echo_skb(): extend to return can frame length 2021-03-30 11:14:28 +02:00
softing can: softing: Remove redundant variable ptr 2021-05-27 09:42:22 +02:00
spi can: hi311x: fix a signedness bug in hi3110_cmd() 2021-07-30 08:45:03 +02:00
usb can: esd_usb2: fix memory leak 2021-07-30 08:47:34 +02:00
Kconfig can: grcan: add missing Kconfig dependency to HAS_IOMEM 2021-03-30 11:14:45 +02:00
Makefile can: dev: move driver related infrastructure into separate subdir 2021-01-13 09:42:58 +01:00
at91_can.c can: at91_can: silence clang warning 2021-05-27 09:42:22 +02:00
flexcan.c can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate 2021-03-16 08:41:26 +01:00
grcan.c can: dev: can_free_echo_skb(): extend to return can frame length 2021-03-30 11:14:28 +02:00
janz-ican3.c can: replace can_dlc as variable/element for payload length 2020-11-20 12:04:12 +01:00
kvaser_pciefd.c can: kvaser_pciefd: Always disable bus load reporting 2021-03-16 08:41:26 +01:00
led.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pch_can.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
slcan.c tty: no checking of tty_unregister_ldisc 2021-05-13 16:57:17 +02:00
sun4i_can.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
ti_hecc.c can: dev: can_rx_offload_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
vcan.c net: introduce CAN specific pointer in the struct net_device 2021-02-24 14:32:15 -08:00
vxcan.c net: introduce CAN specific pointer in the struct net_device 2021-02-24 14:32:15 -08:00
xilinx_can.c can: xilinx_can: Simplify code by using dev_err_probe() 2021-03-30 11:14:46 +02:00