Skip to contentSkip to conversation

bnx2x: add missing napi deletion in error path

PATCH Applied Michal Schmidt 3 participants 3 messages Mar 15, 2013 – Mar 17, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2x: add missing napi deletion in error path

If the hardware initialization fails in bnx2x_nic_load() after adding napi objects, they would not be deleted. A subsequent attempt to unload the bnx2x module detects a corruption in the napi list.

Add the missing napi deletion to the error path.

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 -0
index a923bc4..4046f97 100644
@@ -2760,6 +2760,7 @@ load_error2:
 	bp->port.pmf = 0;
 load_error1:
 	bnx2x_napi_disable(bp);
+	bnx2x_del_all_napi(bp);
 
 	/* clear pf_load status, as it was already set */
 	if (IS_PF(bp))
Signature · 1 line
1.8.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 31 lines

-----Original Message-----
From: Michal Schmidt [mailto:[email protected]]
Sent: Friday, March 15, 2013 5:28 PM
To: [email protected]
Cc: Merav Sicron; Eilon Greenstein; Dmitry Kravkov; Yuval Mintz
Subject: [PATCH net] bnx2x: add missing napi deletion in error path

If the hardware initialization fails in bnx2x_nic_load() after adding napi objects, they would not be deleted. A subsequent attempt to unload the bnx2x module detects a corruption in the napi list.

Add the missing napi deletion to the error path.

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 -1
index a923bc4..4046f97 100644
@@ -2760,6 +2760,7 @@ load_error2:
 	bp->port.pmf = 0;
 load_error1:
 	bnx2x_napi_disable(bp);
+	bnx2x_del_all_napi(bp);
 
 	/* clear pf_load status, as it was already set */
 	if (IS_PF(bp))
--
Quoted 2 lines

1.8.1.4

Thanks, Michal!