linux-stable/drivers/net
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
..
appletalk
arcnet
bonding bonding: fix build issue 2021-07-16 17:22:35 -07:00
caif Networking fixes for 5.14-rc2, including fixes from bpf and netfilter. 2021-07-14 09:24:32 -07:00
can can: esd_usb2: fix memory leak 2021-07-30 08:47:34 +02:00
dsa net: dsa: mv88e6xxx: silently accept the deletion of VID 0 too 2021-07-23 17:13:02 +01:00
ethernet sis900: Fix missing pci_disable_device() in probe and remove 2021-07-28 13:43:49 +01:00
fddi net: fddi: fix UAF in fza_probe 2021-07-13 09:43:50 -07:00
fjes Tracing updates for 5.14: 2021-07-03 11:13:22 -07:00
hamradio TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
hippi
hyperv Networking changes for 5.14. 2021-06-30 15:51:09 -07:00
ieee802154 ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl() 2021-06-22 21:26:59 +02:00
ipa Merge branch 'akpm' (patches from Andrew) 2021-07-02 12:08:10 -07:00
ipvlan
mdio net: mdiobus: withdraw fwnode_mdbiobus_register 2021-06-25 11:46:29 -07:00
mhi wwan: core: add WWAN common private data for netdev 2021-06-22 10:01:17 -07:00
netdevsim net: netdevsim: use xso.real_dev instead of xso.dev in callback functions of struct xfrmdev_ops 2021-07-06 10:36:59 -07:00
pcs
phy net: phy: broadcom: re-add check for PHY_BRCM_DIS_TXCRXC_NOENRGY on the BCM54811 PHY 2021-07-25 10:45:49 +01:00
plip
ppp TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
slip TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
team
usb usb: hso: fix error handling code of hso_create_net_device 2021-07-15 12:36:21 -07:00
vmxnet3 vmxnet3: fix cksum offload issues for tunnels with non-default udp ports 2021-07-02 13:41:15 -07:00
wan Networking fixes for 5.14-rc2, including fixes from bpf and netfilter. 2021-07-14 09:24:32 -07:00
wireguard
wireless virt_wifi: fix error on connect 2021-07-23 10:34:31 +02:00
wwan wwan: core: Fix missing RTM_NEWLINK event for default link 2021-07-23 17:14:00 +01:00
xen-netback
bareudp.c bareudp: allow redirecting bareudp packets to eth devices 2021-06-28 12:44:17 -07:00
dummy.c
eql.c
geneve.c
gtp.c gtp: reset mac_header after decap 2021-06-28 12:44:17 -07:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: fix the length used to copy the key for offloading 2021-06-24 12:41:12 -07:00
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c Networking fixes for 5.14-rc2, including fixes from bpf and netfilter. 2021-07-14 09:24:32 -07:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-29 15:45:27 -07:00
vsockmon.c
vxlan.c vxlan: add missing rcu_read_lock() in neigh_reduce() 2021-06-22 09:48:38 -07:00
xen-netfront.c