2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-11 15:14:03 +08:00

iwlwifi: mvm: unmap the paging memory before freeing it

This led to a DMA splat.

Fixes: a6c4fb4441 ("iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
Emmanuel Grumbach 2016-06-19 20:57:02 +03:00 committed by Luca Coelho
parent 5e7d7eb9cc
commit 3edbc7daba

View File

@ -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;