clear flag on stop at proper location to avoid race conditions.
Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
 {
        struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
 
+       bp->flags &= ~BNXT_FLAG_INIT_DONE;
        if (bp->eth_dev->data->dev_started) {
                /* TBD: STOP HW queues DMA */
                eth_dev->data->dev_link.link_status = 0;
        }
        bnxt_set_hwrm_link_config(bp, false);
        bnxt_hwrm_port_clr_stats(bp);
-       bp->flags &= ~BNXT_FLAG_INIT_DONE;
        bnxt_shutdown_nic(bp);
        bp->dev_stopped = 1;
 }