浏览代码

iwlwifi: pcie: make ctxt-info free idempotent

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>
Johannes Berg 8 年之前
父节点
当前提交
87fc030231
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c

+ 2 - 0
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c

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