All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bnx2x: Fix potential IRO array leak on removal
@ 2026-11-12 13:59 Guangshuo Li
  2026-11-12 14:02 ` netdev-bot+sinfo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guangshuo Li @ 2026-11-12 13:59 UTC (permalink / raw)
  To: Sudarsana Kalluru, Manish Chopra, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel

Firmware initialization allocates a separate IRO array, but
bnx2x_release_firmware() only frees the other parsed tables. Removing
the device loses the array pointer with the netdev.

Free the IRO array with the remaining firmware tables.

This issue was found by our static analysis tool under development.

Fixes: 523224a3b3cd ("bnx2x, cnic, bnx2i: use new FW/HSI")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 277c7bd9c6e7..c6afde9466be 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13489,6 +13489,7 @@ static int bnx2x_init_firmware(struct bnx2x *bp)
 
 static void bnx2x_release_firmware(struct bnx2x *bp)
 {
+	kfree(bp->iro_arr);
 	kfree(bp->init_ops_offsets);
 	kfree(bp->init_ops);
 	kfree(bp->init_data);

base-commit: 2e54b3e187300893688c2c7517894f5d96732e05

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-18  1:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 13:59 [PATCH net] bnx2x: Fix potential IRO array leak on removal Guangshuo Li
2026-11-12 14:02 ` netdev-bot+sinfo
2026-11-17 11:55 ` Daniel Machon
2026-11-18  1:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.