Netdev List
 help / color / mirror / Atom feed
* [PATCH] bnx2: Free temporary statistics on netdevice registration failure
@ 2026-11-28 12:48 Haoxiang Li
  2026-11-28 12:53 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Haoxiang Li @ 2026-11-28 12:48 UTC (permalink / raw)
  To: rmody, GR-Linux-NIC-Dev, andrew+netdev, davem, edumazet, kuba,
	pabeni, michael.chan
  Cc: netdev, Haoxiang Li

bnx2_init_board() allocates bp->temp_stats_blk. Free it
if register_netdev() fails after board initialization,
alongside the other board resources.

Fixes: 354fcd7774a0 ("bnx2: Save statistics during reset.")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
 drivers/net/ethernet/broadcom/bnx2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 39a62d5c1661..7c094f1b5664 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -8600,6 +8600,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return 0;
 
 error:
+	kfree(bp->temp_stats_blk);
 	pci_iounmap(pdev, bp->regview);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-- 
2.25.1


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

end of thread, other threads:[~2026-11-28 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 12:48 [PATCH] bnx2: Free temporary statistics on netdevice registration failure Haoxiang Li
2026-11-28 12:53 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox