e1000/base: improve error handling
[dpdk.git] / lib / librte_pmd_e1000 / e1000 / e1000_ich8lan.c
index 99ba605..dcce62a 100644 (file)
@@ -619,13 +619,12 @@ STATIC s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
        DEBUGFUNC("e1000_init_nvm_params_ich8lan");
 
        /* Can't read flash registers if the register set isn't mapped. */
+       nvm->type = e1000_nvm_flash_sw;
        if (!hw->flash_address) {
                DEBUGOUT("ERROR: Flash registers not mapped\n");
                return -E1000_ERR_CONFIG;
        }
 
-       nvm->type = e1000_nvm_flash_sw;
-
        gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG);
 
        /* sector_X_addr is a "sector"-aligned address (4096 bytes)