Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 905e36ae authored by Matti Gottlieb's avatar Matti Gottlieb Committed by Emmanuel Grumbach
Browse files

iwlwifi: mvm: Fix paging memory leak



If the opmode is stopped and started again we did not free
the paging buffers. Fix that.
In addition when freeing the firmware's paging download
buffer, set the pointer to NULL.

Signed-off-by: default avatarMatti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent fb896c44
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
				    sizeof(tx_ant_cmd), &tx_ant_cmd);
}

static void iwl_free_fw_paging(struct iwl_mvm *mvm)
void iwl_free_fw_paging(struct iwl_mvm *mvm)
{
	int i;

@@ -127,6 +127,8 @@ static void iwl_free_fw_paging(struct iwl_mvm *mvm)
			     get_order(mvm->fw_paging_db[i].fw_paging_size));
	}
	kfree(mvm->trans->paging_download_buf);
	mvm->trans->paging_download_buf = NULL;

	memset(mvm->fw_paging_db, 0, sizeof(mvm->fw_paging_db));
}

+3 −0
Original line number Diff line number Diff line
@@ -1225,6 +1225,9 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
void iwl_mvm_rx_umac_scan_iter_complete_notif(struct iwl_mvm *mvm,
					      struct iwl_rx_cmd_buffer *rxb);

/* Paging */
void iwl_free_fw_paging(struct iwl_mvm *mvm);

/* MVM debugfs */
#ifdef CONFIG_IWLWIFI_DEBUGFS
int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir);
+2 −0
Original line number Diff line number Diff line
@@ -684,6 +684,8 @@ 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);