From: Chas Williams <3chas3@gmail.com> Date: Tue, 8 Dec 2015 14:48:24 +0000 (-0500) Subject: bnx2x: fix double init check X-Git-Tag: spdx-start~7809 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=537ae1c996c824a9108c8dc05d236bd79ecae2c9;p=dpdk.git bnx2x: fix double init check 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. Signed-off-by: Chas Williams <3chas3@gmail.com> --- diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 294711fbb2..2dc2a47b73 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -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;