From: Moshe Harel Date: Thu, 10 Sep 2015 12:29:09 +0000 (+0300) Subject: iwlwifi: nvm: free old section data when reading nvm file X-Git-Tag: v4.4-rc1~141^2~39^2~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2edb7a3372c76c9379d0fc00e4274ea8f018248a;p=platform%2Fkernel%2Flinux-exynos.git iwlwifi: nvm: free old section data when reading nvm file When reading external NVM file, if a section exists both in OTP and in the external file, the memory that was allocated at OTP reading is not freed. This is possible only on systems that have an external NVM file which is typically the case on embedded systems. Signed-off-by: Moshe Harel Signed-off-by: Emmanuel Grumbach --- diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c index 4e4a680..2ee0f6f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c @@ -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;