iwlwifi: pcie: make ctxt-info free idempotent
authorJohannes Berg <johannes.berg@intel.com>
Wed, 31 May 2017 11:15:18 +0000 (13:15 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 29 Jun 2017 10:26:26 +0000 (13:26 +0300)
By setting the pointers to NULL at the end, these functions
are made idempotent.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c

index b1f43397bb59a72dbefd7fc1aab72d8a6de3d7b4..00d1a5f048b354b0f1f97c0a773d5a1aea0dd9ec 100644 (file)
@@ -103,6 +103,7 @@ static void iwl_pcie_ctxt_info_free_fw_img(struct iwl_trans *trans)
 
        kfree(dram->fw);
        dram->fw_cnt = 0;
+       dram->fw = NULL;
 }
 
 void iwl_pcie_ctxt_info_free_paging(struct iwl_trans *trans)
@@ -124,6 +125,7 @@ void iwl_pcie_ctxt_info_free_paging(struct iwl_trans *trans)
 
        kfree(dram->paging);
        dram->paging_cnt = 0;
+       dram->paging = NULL;
 }
 
 static int iwl_pcie_ctxt_info_init_fw_sec(struct iwl_trans *trans,