Skip to contentSkip to conversation

bnx2x: check sc->state to prevent double init

PATCH Applied Chas Williams 2 participants 2 messages Dec 8, 2015 – Dec 9, 2015 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2x: check sc->state to prevent double init

If the link is up, then the driver cannot be stopped and started successfully. Instead of checking the link status, use the driver's state.

---
 drivers/net/bnx2x/bnx2x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnx2x/bnx2x.c +1 -1
index 294711f..2dc2a47 100644
@@ -7430,7 +7430,7 @@ int bnx2x_init(struct bnx2x_softc *sc)
 	int rc;
 
 	/* Check if the driver is still running and bail out if it is. */
-	if (sc->link_vars.link_up) {
+	if (sc->state != BNX2X_STATE_CLOSED) {
 		PMD_DRV_LOG(DEBUG, "Init called while driver is running!");
 		rc = 0;
 		goto bnx2x_init_done;
Signature · 1 line
2.1.0
#1 lore raw

2015-12-08 09:48, Chas Williams:

Quoted 5 lines

If the link is up, then the driver cannot be stopped and started successfully. Instead of checking the link status, use the driver's state.

Applied, thanks