]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/bnxt/bnxt_hwrm.c
net/bnxt: fix resource cleanup
[dpdk.git] / drivers / net / bnxt / bnxt_hwrm.c
index 6a70b6e66387240372ec7ef56f88ebc0f132b167..cb2064dd57032d0fed9c94d05248e7335c65ccb9 100644 (file)
@@ -792,6 +792,9 @@ void bnxt_free_vf_info(struct bnxt *bp)
 {
        int i;
 
+       if (bp->pf == NULL)
+               return;
+
        if (bp->pf->vf_info == NULL)
                return;
 
@@ -1364,6 +1367,9 @@ int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags)
        HWRM_CHECK_RESULT();
        HWRM_UNLOCK();
 
+       PMD_DRV_LOG(DEBUG, "Port %u: Unregistered with fw\n",
+                   bp->eth_dev->data->port_id);
+
        return rc;
 }
 
@@ -1448,8 +1454,6 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf)
        HWRM_CHECK_RESULT();
        HWRM_UNLOCK();
 
-       PMD_DRV_LOG(DEBUG, "Port %u: Unregistered with fw\n",
-                   bp->eth_dev->data->port_id);
        return rc;
 }