iwlwifi: dbg: use dump mask for tx command dumping length
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Thu, 7 Feb 2019 07:07:16 +0000 (09:07 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Mar 2019 10:59:41 +0000 (12:59 +0200)
Only add the size of the tx command to the dump file size if it is set
in the dump_mask.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

index fe8269d023def832e97701bc7c1bd0c57df05a96..424dfae05c1775410d5e13bdddaaf6b0479558a9 100644 (file)
@@ -3165,8 +3165,10 @@ static struct iwl_trans_dump_data
        len = sizeof(*dump_data);
 
        /* host commands */
-       len += sizeof(*data) +
-               cmdq->n_window * (sizeof(*txcmd) + TFD_MAX_PAYLOAD_SIZE);
+       if (dump_mask & BIT(IWL_FW_ERROR_DUMP_TXCMD))
+               len += sizeof(*data) +
+                       cmdq->n_window * (sizeof(*txcmd) +
+                                         TFD_MAX_PAYLOAD_SIZE);
 
        /* FW monitor */
        if (dump_mask & BIT(IWL_FW_ERROR_DUMP_FW_MONITOR))