iwlwifi: dbg: use dump mask for tx command dumping length

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>
This commit is contained in:
Shahar S Matityahu 2019-02-07 09:07:16 +02:00 committed by Luca Coelho
parent e4fe5d4b10
commit 8672aad310

View 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))