]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: reset the fw_dump_desc pointer after ASSERT
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 10 May 2017 05:49:41 +0000 (08:49 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 23 Jun 2017 09:09:13 +0000 (12:09 +0300)
When we get an ASSERT, the fw_dump_desc pointer points to
iwl_mvm_dump_desc_assert which can't be freed since it is
a global. We still need to NULL'ify the pointer when we
call iwl_mvm_free_fw_dump_desc otherwise we will hit

int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm,
                                const struct iwl_mvm_dump_desc *desc,
                                const struct iwl_fw_dbg_trigger_tlv *trigger)
{
<snip>
        if (WARN_ON(mvm->fw_dump_desc))
                iwl_mvm_free_fw_dump_desc(mvm);

Fixes: b6eaa45aa18b ("iwlwifi: mvm: add the cause of the firmware dump in the dump")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c

index d5cb47e2fe449ee6bb078dfc368184d832c8a1a7..1602b360353c7e52bf49d42f9ee5deabb7c1e899 100644 (file)
@@ -319,10 +319,8 @@ static void iwl_mvm_dump_fifos(struct iwl_mvm *mvm,
 
 void iwl_mvm_free_fw_dump_desc(struct iwl_mvm *mvm)
 {
-       if (mvm->fw_dump_desc == &iwl_mvm_dump_desc_assert)
-               return;
-
-       kfree(mvm->fw_dump_desc);
+       if (mvm->fw_dump_desc != &iwl_mvm_dump_desc_assert)
+               kfree(mvm->fw_dump_desc);
        mvm->fw_dump_desc = NULL;
 }