iwlwifi: nvm: free old section data when reading nvm file
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / mvm / nvm.c
index 4e4a680..2ee0f6f 100644 (file)
@@ -483,6 +483,7 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm)
                        ret = -ENOMEM;
                        break;
                }
+               kfree(mvm->nvm_sections[section_id].data);
                mvm->nvm_sections[section_id].data = temp;
                mvm->nvm_sections[section_id].length = section_size;