net/bnxt: fix lock release on getting NVM info
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Thu, 18 Jul 2019 03:36:07 +0000 (09:06 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
HWRM response was parsed after releasing the spinlock.

Fixes: 19e6af01bb36 ("net/bnxt: support get/set EEPROM")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c

index 456cc76..2e198fc 100644 (file)
@@ -3574,12 +3574,11 @@ int bnxt_hwrm_nvm_get_dir_info(struct bnxt *bp, uint32_t *entries,
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
 
        HWRM_CHECK_RESULT();
-       HWRM_UNLOCK();
 
-       if (!rc) {
-               *entries = rte_le_to_cpu_32(resp->entries);
-               *length = rte_le_to_cpu_32(resp->entry_length);
-       }
+       *entries = rte_le_to_cpu_32(resp->entries);
+       *length = rte_le_to_cpu_32(resp->entry_length);
+
+       HWRM_UNLOCK();
        return rc;
 }