linux/drivers/net
Russell King (Oracle) 29f50bcf0f net: mvpp2: fix mvpp2 debugfs leak
[ Upstream commit 0152dfee23 ]

When mvpp2 is unloaded, the driver specific debugfs directory is not
removed, which technically leads to a memory leak. However, this
directory is only created when the first device is probed, so the
hardware is present. Removing the module is only something a developer
would to when e.g. testing out changes, so the module would be
reloaded. So this memory leak is minor.

The original attempt in commit fe2c9c61f6 ("net: mvpp2: debugfs: fix
memory leak when using debugfs_lookup()") that was labelled as a memory
leak fix was not, it fixed a refcount leak, but in doing so created a
problem when the module is reloaded - the directory already exists, but
mvpp2_root is NULL, so we lose all debugfs entries. This fix has been
reverted.

This is the alternative fix, where we remove the offending directory
whenever the driver is unloaded.

Fixes: 21da57a231 ("net: mvpp2: add a debugfs interface for the Header Parser")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Marcin Wojtas <mw@semihalf.com>
Link: https://lore.kernel.org/r/E1ofOAB-00CzkG-UO@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:24 +02:00
..
appletalk
arcnet
bonding net: bonding: Unsync device addresses on ndo_stop 2022-09-28 11:10:31 +02:00
caif
can can: kvaser_usb_leaf: Fix CAN state after restart 2022-10-26 13:25:08 +02:00
dsa net: mt7531: only do PLL once after the reset 2022-10-05 10:38:39 +02:00
ethernet net: mvpp2: fix mvpp2 debugfs leak 2022-10-26 13:25:24 +02:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 ieee802154: cc2520: add rc code in cc2520_tx() 2022-09-20 12:38:32 +02:00
ipa net: ipa: properly limit modem routing table use 2022-09-28 11:10:34 +02:00
ipvlan ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header 2022-09-28 11:10:30 +02:00
mdio of: mdio: Add of_node_put() when breaking out of for_each_xx 2022-09-28 11:10:33 +02:00
netdevsim net: Use u64_stats_fetch_begin_irq() for stats fetch. 2022-09-08 11:11:40 +02:00
pcs
phy net: phy: aquantia: wait for the suspend/resume operations to finish 2022-09-28 11:10:31 +02:00
plip plip: avoid rcu debug splat 2022-08-25 11:37:59 +02:00
ppp
slip
team net: team: Unsync device addresses on ndo_stop 2022-09-28 11:10:31 +02:00
usb usbnet: Fix memory leak in usbnet_disconnect() 2022-10-05 10:38:42 +02:00
vmxnet3
wan
wimax
wireguard wireguard: netlink: avoid variable-sized memcpy on sockaddr 2022-09-28 11:10:34 +02:00
wireless wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM 2022-10-26 13:25:22 +02:00
xen-netback xen-netback: only remove 'hotplug-status' when the vif is actually destroyed 2022-09-15 11:32:05 +02:00
bareudp.c
dummy.c
eql.c
geneve.c geneve: fix TOS inheriting for ipv4 2022-08-25 11:38:02 +02:00
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa() 2022-08-03 12:00:48 +02: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 net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() 2022-08-03 12:00:46 +02:00
tap.c
thunderbolt.c
tun.c tun: avoid double free in tun_free_netdev 2022-08-11 13:06:44 +02:00
veth.c
virtio_net.c virtio_net: fix memory leak inside XPD_TX with mergeable 2022-08-25 11:37:57 +02:00
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c