iwlwifi: mvm: fix bug in parse_nvm_sections
authorEran Harary <eran.harary@intel.com>
Wed, 30 Apr 2014 12:31:59 +0000 (15:31 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 6 May 2014 17:40:04 +0000 (20:40 +0300)
The old code checks if hw_section_num is valid while the
right thing to do is to check if section[hw_section_num].data
is valid.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/nvm.c

index 6d0e659c3decd340d2d55318581e5ddb1024d45f..6b88c29ebe6b7a3e812f61321250e13911560d3f 100644 (file)
@@ -246,7 +246,7 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
                        return NULL;
                }
                /* MAC_OVERRIDE or at least HW section must exist */
-               if (!mvm->cfg->nvm_hw_section_num &&
+               if (!mvm->nvm_sections[mvm->cfg->nvm_hw_section_num].data &&
                    !mvm->nvm_sections[NVM_SECTION_TYPE_MAC_OVERRIDE].data) {
                        IWL_ERR(mvm,
                                "Can't parse mac_address, empty sections\n");