فهرست منبع

iwlwifi: mvm: fix memory leak in paging

Currently paging download buffer is freed during the
the unloading of the opmode which happens when the driver
is unloaded.

This causes a memory leak since the paging download
buffer is allocated every time we enable the
interface, so the download buffer can be allocated many
times, but only be freed once.

Free paging download buffer during disabling of the
interface.

CC: stable@vger.kernel.org [4.3+]
Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Matti Gottlieb 9 سال پیش
والد
کامیت
7fdf966326
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 0
      drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
  2. 0 2
      drivers/net/wireless/intel/iwlwifi/mvm/ops.c

+ 2 - 0
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

@@ -1147,6 +1147,8 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
 	/* the fw is stopped, the aux sta is dead: clean up driver state */
 	iwl_mvm_del_aux_sta(mvm);
 
+	iwl_free_fw_paging(mvm);
+
 	/*
 	 * Clear IN_HW_RESTART flag when stopping the hw (as restart_complete()
 	 * won't be called in this case).

+ 0 - 2
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

@@ -761,8 +761,6 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)
 	for (i = 0; i < NVM_MAX_NUM_SECTIONS; i++)
 		kfree(mvm->nvm_sections[i].data);
 
-	iwl_free_fw_paging(mvm);
-
 	iwl_mvm_tof_clean(mvm);
 
 	ieee80211_free_hw(mvm->hw);