WSL2-Linux-Kernel/drivers/net/ethernet/broadcom/bnx2x
Jianglei Nie 0b6516a4e3 bnx2x: fix potential memory leak in bnx2x_tpa_stop()
[ Upstream commit b43f9acbb8 ]

bnx2x_tpa_stop() allocates a memory chunk from new_data with
bnx2x_frag_alloc(). The new_data should be freed when gets some error.
But when "pad + len > fp->rx_buf_size" is true, bnx2x_tpa_stop() returns
without releasing the new_data, which will lead to a memory leak.

We should free the new_data with bnx2x_frag_free() when "pad + len >
fp->rx_buf_size" is true.

Fixes: 07b0f00964 ("bnx2x: fix possible panic under memory stress")
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 12:34:49 +02:00
..
Makefile
bnx2x.h bnx2x: fix built-in kernel driver load failure 2022-03-23 09:16:42 +01:00
bnx2x_cmn.c bnx2x: fix potential memory leak in bnx2x_tpa_stop() 2022-10-26 12:34:49 +02:00
bnx2x_cmn.h
bnx2x_dcb.c
bnx2x_dcb.h
bnx2x_dump.h
bnx2x_ethtool.c
bnx2x_fw_defs.h
bnx2x_fw_file_hdr.h
bnx2x_hsi.h
bnx2x_init.h
bnx2x_init_ops.h
bnx2x_link.c
bnx2x_link.h
bnx2x_main.c bnx2x: fix napi API usage sequence 2022-05-09 09:14:38 +02:00
bnx2x_mfw_req.h
bnx2x_reg.h
bnx2x_self_test.c
bnx2x_sp.c
bnx2x_sp.h
bnx2x_sriov.c bnx2x: Invalidate fastpath HSI version for VFs 2022-01-29 10:58:24 +01:00
bnx2x_sriov.h
bnx2x_stats.c
bnx2x_stats.h
bnx2x_vfpf.c
bnx2x_vfpf.h