diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 93f0d387688a..bcdd4c2a8b67 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -522,6 +522,11 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, goto error; } + if (WARN(!tfd_sz, "tfd_sz is 0 - tfh:%d, slots:%d, tfd_size:%d, maxq:%d\n", + trans->cfg->use_tfh, slots_num, trans_pcie->tfd_size, + trans->cfg->base_params->max_tfd_queue_size)) + goto error; + /* Circular buffer of transmit frame descriptors (TFDs), * shared with device */ txq->tfds = dma_alloc_coherent(trans->dev, tfd_sz, @@ -533,6 +538,10 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, tb0_buf_sz = sizeof(*txq->first_tb_bufs) * slots_num; + if (WARN(!tb0_buf_sz, "tb0_buf_sz is 0 - slots:%d, sizeof:%d\n", + slots_num, sizeof(*txq->first_tb_bufs))) + goto error; + txq->first_tb_bufs = dma_alloc_coherent(trans->dev, tb0_buf_sz, &txq->first_tb_dma, GFP_KERNEL);