Commit 3edbc7da authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Luca Coelho

iwlwifi: mvm: unmap the paging memory before freeing it

This led to a DMA splat.

Fixes: a6c4fb44 ("iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI")
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 5e7d7eb9
...@@ -160,17 +160,21 @@ void iwl_free_fw_paging(struct iwl_mvm *mvm) ...@@ -160,17 +160,21 @@ void iwl_free_fw_paging(struct iwl_mvm *mvm)
return; return;
for (i = 0; i < NUM_OF_FW_PAGING_BLOCKS; i++) { for (i = 0; i < NUM_OF_FW_PAGING_BLOCKS; i++) {
if (!mvm->fw_paging_db[i].fw_paging_block) { struct iwl_fw_paging *paging = &mvm->fw_paging_db[i];
if (!paging->fw_paging_block) {
IWL_DEBUG_FW(mvm, IWL_DEBUG_FW(mvm,
"Paging: block %d already freed, continue to next page\n", "Paging: block %d already freed, continue to next page\n",
i); i);
continue; continue;
} }
dma_unmap_page(mvm->trans->dev, paging->fw_paging_phys,
paging->fw_paging_size, DMA_BIDIRECTIONAL);
__free_pages(mvm->fw_paging_db[i].fw_paging_block, __free_pages(paging->fw_paging_block,
get_order(mvm->fw_paging_db[i].fw_paging_size)); get_order(paging->fw_paging_size));
mvm->fw_paging_db[i].fw_paging_block = NULL; paging->fw_paging_block = NULL;
} }
kfree(mvm->trans->paging_download_buf); kfree(mvm->trans->paging_download_buf);
mvm->trans->paging_download_buf = NULL; mvm->trans->paging_download_buf = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment