linux/drivers/net/ethernet
Taehee Yoo 1fa89ffbc0 net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe()
In the NIC ->probe() callback, ->mtd_probe() callback is called.
If NIC has 2 ports, ->probe() is called twice and ->mtd_probe() too.
In the ->mtd_probe(), which is efx_ef10_mtd_probe() it allocates and
initializes mtd partiion.
But mtd partition for sfc is shared data.
So that allocated mtd partition data from last called
efx_ef10_mtd_probe() will not be used.
Therefore it must be freed.
But it doesn't free a not used mtd partition data in efx_ef10_mtd_probe().

kmemleak reports:
unreferenced object 0xffff88811ddb0000 (size 63168):
  comm "systemd-udevd", pid 265, jiffies 4294681048 (age 348.586s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffffa3767749>] kmalloc_order_trace+0x19/0x120
    [<ffffffffa3873f0e>] __kmalloc+0x20e/0x250
    [<ffffffffc041389f>] efx_ef10_mtd_probe+0x11f/0x270 [sfc]
    [<ffffffffc0484c8a>] efx_pci_probe.cold.17+0x3df/0x53d [sfc]
    [<ffffffffa414192c>] local_pci_probe+0xdc/0x170
    [<ffffffffa4145df5>] pci_device_probe+0x235/0x680
    [<ffffffffa443dd52>] really_probe+0x1c2/0x8f0
    [<ffffffffa443e72b>] __driver_probe_device+0x2ab/0x460
    [<ffffffffa443e92a>] driver_probe_device+0x4a/0x120
    [<ffffffffa443f2ae>] __driver_attach+0x16e/0x320
    [<ffffffffa4437a90>] bus_for_each_dev+0x110/0x190
    [<ffffffffa443b75e>] bus_add_driver+0x39e/0x560
    [<ffffffffa4440b1e>] driver_register+0x18e/0x310
    [<ffffffffc02e2055>] 0xffffffffc02e2055
    [<ffffffffa3001af3>] do_one_initcall+0xc3/0x450
    [<ffffffffa33ca574>] do_init_module+0x1b4/0x700

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
Fixes: 8127d661e7 ("sfc: Add support for Solarflare SFC9100 family")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20220512054709.12513-1-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-05-12 10:01:36 -07:00
..
3com
8390 ethernet: 8390: Remove unnecessary print function dev_err() 2022-03-11 22:59:03 -08:00
actions
adaptec
aeroflex
agere
alacritech
allwinner
alteon
altera
amazon
amd
apm drivers: net: xgene: Fix regression in CRC stripping 2022-03-23 10:30:05 -07:00
apple
aquantia net: atlantic: verify hw_head_ lies within TX buffer ring 2022-05-11 12:25:07 +01:00
arc net: arc_emac: Fix use after free in arc_mdio_probe() 2022-03-10 14:49:21 -08:00
asix net: ethernet: Use netif_rx(). 2022-03-04 12:02:19 +00:00
atheros atl1c: remove redundant assignment to variable size 2022-03-18 14:16:47 -07:00
broadcom net: bcmgenet: Check for Wake-on-LAN interrupt probe deferral 2022-05-12 09:58:58 +02:00
brocade
cadence net: macb: Restart tx only if queue pointer is lagging 2022-04-11 18:18:07 -07:00
calxeda
cavium pci_irq_vector() can't be used in atomic context any longer. This conflicts 2022-05-01 17:02:23 +01:00
chelsio net: chelsio: cxgb4: Avoid potential negative array offset 2022-05-06 15:41:27 -07:00
cirrus
cisco
cortina
davicom net: ethernet: Use netif_rx(). 2022-03-04 12:02:19 +00:00
dec ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() 2022-05-09 15:52:38 -07:00
dlink
emulex
engleder
ezchip net: ethernet: ezchip: fix platform_get_irq.cocci warning 2022-03-11 11:07:23 +00:00
faraday net: ftgmac100: access hardware register after clock ready 2022-04-13 12:43:55 +01:00
freescale net: enetc: allow tc-etf offload even with NETIF_F_CSUM_MASK 2022-04-28 09:45:48 -07:00
fujitsu
fungible net/fungible: Fix reference to __udivdi3 on 32b builds 2022-04-01 21:32:30 -07:00
google gve: Fix spelling mistake "droping" -> "dropping" 2022-03-16 19:29:00 -07:00
hisilicon net: hns: Add missing fwnode_handle_put in hns_mac_init 2022-04-25 11:06:53 +01:00
huawei hinic: fix bug of wq out of bound access 2022-04-29 18:37:45 -07:00
i825xx Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
ibm Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits" 2022-04-28 09:46:18 -07:00
intel i40e: i40e_main: fix a missing check on list iterator 2022-05-11 15:19:28 -07:00
litex
marvell net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address() 2022-04-05 18:12:55 -07:00
mediatek net: ethernet: mediatek: ppe: fix wrong size passed to memset() 2022-05-12 09:44:14 +02:00
mellanox mlxsw: Avoid warning during ip6gre device removal 2022-05-12 13:21:16 +02:00
micrel net: micrel: Fix KS8851 Kconfig 2022-04-05 17:32:05 -07:00
microchip net: lan966x: fix a couple off by one bugs 2022-04-25 11:25:37 +01:00
microsoft
moxa
mscc net: mscc: ocelot: avoid corrupting hardware counters when moving VCAP filters 2022-05-05 19:15:17 -07:00
myricom myri10ge: fix an incorrect free for skb in myri10ge_sw_tso 2022-04-06 15:29:18 +01:00
natsemi
neterion
netronome devlink: hold the instance lock during eswitch_mode callbacks 2022-03-21 14:11:38 +00:00
ni
nvidia
nxp net: ethernet: lpc_eth: Handle error for clk_enable 2022-03-09 12:15:20 +00:00
oki-semi
packetengines drivers: net: packetengines: fix typos in comments 2022-03-14 10:04:28 -07:00
pasemi
pensando ionic: fix missing pci_release_regions() on error in ionic_probe() 2022-05-09 15:49:12 -07:00
qlogic qede: confirm skb is allocated before using 2022-04-06 15:16:23 +01:00
qualcomm net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
rdc
realtek r8169: improve driver unload and system shutdown behavior on DASH-enabled systems 2022-03-17 16:47:32 -07:00
renesas
rocker
samsung Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-03 11:55:12 -08:00
seeq
sfc net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() 2022-05-12 10:01:36 -07:00
sgi
silan
sis
smsc smsc911x: allow using IRQ0 2022-05-03 16:57:33 -07:00
socionext net: netsec: enable pp skb recycling 2022-02-28 11:39:23 +00:00
stmicro net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe() 2022-05-10 19:12:57 -07:00
sun ethernet: sun: Fix spelling mistake "mis-matched" -> "mismatched" 2022-03-17 16:36:05 -07:00
synopsys
tehuti
ti net: cpsw: add missing of_node_put() in cpsw_probe_dt() 2022-04-30 13:37:20 +01:00
toshiba
tundra
vertexcom net: ethernet: Use netif_rx(). 2022-03-04 12:02:19 +00:00
via
wiznet net: ethernet: Use netif_rx(). 2022-03-04 12:02:19 +00:00
xilinx net: emaclite: Add error handling for of_address_to_resource() 2022-05-03 11:07:32 +02:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: ethernet: use time_is_before_eq_jiffies() instead of open coding it 2022-02-28 13:21:31 +00:00
jme.h
Kconfig net: restore alpha order to Ethernet devices in config 2022-04-15 11:56:16 +01:00
korina.c
lantiq_etop.c
lantiq_xrx200.c net: lantiq_xrx200: fix use after free bug 2022-03-07 11:29:35 +00:00
Makefile net/fungible: Kconfig, Makefiles, and MAINTAINERS 2022-02-27 10:51:23 +00:00