2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00
linux-next/drivers/net
Valentine Fatiev 94b960b9de net/mlx5e: Fix memory leak in mlx5_core_destroy_cq() error path
Prior to this patch in case mlx5_core_destroy_cq() failed it returns
without completing all destroy operations and that leads to memory leak.
Instead, complete the destroy flow before return error.

Also move mlx5_debug_cq_remove() to the beginning of mlx5_core_destroy_cq()
to be symmetrical with mlx5_core_create_cq().

kmemleak complains on:

unreferenced object 0xc000000038625100 (size 64):
  comm "ethtool", pid 28301, jiffies 4298062946 (age 785.380s)
  hex dump (first 32 bytes):
    60 01 48 94 00 00 00 c0 b8 05 34 c3 00 00 00 c0  `.H.......4.....
    02 00 00 00 00 00 00 00 00 db 7d c1 00 00 00 c0  ..........}.....
  backtrace:
    [<000000009e8643cb>] add_res_tree+0xd0/0x270 [mlx5_core]
    [<00000000e7cb8e6c>] mlx5_debug_cq_add+0x5c/0xc0 [mlx5_core]
    [<000000002a12918f>] mlx5_core_create_cq+0x1d0/0x2d0 [mlx5_core]
    [<00000000cef0a696>] mlx5e_create_cq+0x210/0x3f0 [mlx5_core]
    [<000000009c642c26>] mlx5e_open_cq+0xb4/0x130 [mlx5_core]
    [<0000000058dfa578>] mlx5e_ptp_open+0x7f4/0xe10 [mlx5_core]
    [<0000000081839561>] mlx5e_open_channels+0x9cc/0x13e0 [mlx5_core]
    [<0000000009cf05d4>] mlx5e_switch_priv_channels+0xa4/0x230
[mlx5_core]
    [<0000000042bbedd8>] mlx5e_safe_switch_params+0x14c/0x300
[mlx5_core]
    [<0000000004bc9db8>] set_pflag_tx_port_ts+0x9c/0x160 [mlx5_core]
    [<00000000a0553443>] mlx5e_set_priv_flags+0xd0/0x1b0 [mlx5_core]
    [<00000000a8f3d84b>] ethnl_set_privflags+0x234/0x2d0
    [<00000000fd27f27c>] genl_family_rcv_msg_doit+0x108/0x1d0
    [<00000000f495e2bb>] genl_family_rcv_msg+0xe4/0x1f0
    [<00000000646c5c2c>] genl_rcv_msg+0x78/0x120
    [<00000000d53e384e>] netlink_rcv_skb+0x74/0x1a0

Fixes: e126ba97db ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Valentine Fatiev <valentinef@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
2021-10-12 13:51:52 -07:00
..
appletalk
arcnet
bonding bonding: 3ad: pass parameter bond_params by reference 2021-09-07 10:28:50 +01:00
caif
can can: c_can: fix null-ptr-deref on ioctl() 2021-09-07 08:46:58 +02:00
dsa net: dsa: microchip: Added the condition for scheduling ksz_mib_read_work 2021-10-12 11:35:53 +01:00
ethernet net/mlx5e: Fix memory leak in mlx5_core_destroy_cq() error path 2021-10-12 13:51:52 -07:00
fddi fddi: switch from 'pci_' to 'dma_' API 2021-08-29 10:50:24 +01:00
fjes
hamradio dmascc: add CONFIG_VIRT_TO_BUS dependency 2021-09-28 13:12:07 +01:00
hippi
hyperv
ieee802154
ipa net: ipa: initialize all filter table slots 2021-09-08 12:10:33 +01:00
ipvlan
mctp
mdio net: mdio-ipq4019: Fix the error for an optional regs resource 2021-09-28 17:28:54 -07:00
netdevsim Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
pcs net: pcs: xpcs: fix incorrect steps on disable EEE 2021-10-06 11:18:27 +01:00
phy net: phy: Do not shutdown PHYs in READY state 2021-10-09 13:47:37 +01:00
plip
ppp
slip
team
usb r8152: select CRC32 and CRYPTO/CRYPTO_HASH/CRYPTO_SHA256 2021-10-12 11:33:32 +01:00
vmxnet3 ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
wan net: wan: wanxl: define CROSS_COMPILE_M68K 2021-09-16 14:08:04 +01:00
wireguard
wireless wireless-drivers fixes for v5.15 2021-10-01 14:16:29 +01:00
wwan Networking stragglers and fixes for 5.15-rc1, including changes from netfilter, 2021-09-07 14:02:58 -07:00
xen-netback xen-netback: correct success/error reporting for the SKB-with-fraglist case 2021-09-19 12:10:26 +01:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c drivers: net: mhi: fix error path in mhi_net_newlink 2021-09-24 14:25:05 +01:00
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 ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
veth.c
virtio_net.c virtio-net: fix for skb_over_panic inside big mode 2021-10-09 13:50:33 +01:00
vrf.c
vsockmon.c
vxlan.c nexthop: Fix memory leaks in nexthop notification chain listeners 2021-09-23 12:33:22 +01:00
xen-netfront.c xen/netfront: don't trust the backend response data blindly 2021-08-25 10:43:21 +01:00