|
@@ -367,16 +367,17 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm)
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+ if (WARN(section_id >= NVM_NUM_OF_SECTIONS,
|
|
|
+ "Invalid NVM section ID %d\n", section_id)) {
|
|
|
+ ret = -EINVAL;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
temp = kmemdup(file_sec->data, section_size, GFP_KERNEL);
|
|
|
if (!temp) {
|
|
|
ret = -ENOMEM;
|
|
|
break;
|
|
|
}
|
|
|
- if (WARN_ON(section_id >= NVM_NUM_OF_SECTIONS)) {
|
|
|
- IWL_ERR(mvm, "Invalid NVM section ID\n");
|
|
|
- ret = -EINVAL;
|
|
|
- break;
|
|
|
- }
|
|
|
mvm->nvm_sections[section_id].data = temp;
|
|
|
mvm->nvm_sections[section_id].length = section_size;
|
|
|
|