diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 58118c8224cf..7d2b6e11f73e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -278,6 +278,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv, | |||
278 | struct iwl_tx_queue *txq, u32 id) | 278 | struct iwl_tx_queue *txq, u32 id) |
279 | { | 279 | { |
280 | struct pci_dev *dev = priv->pci_dev; | 280 | struct pci_dev *dev = priv->pci_dev; |
281 | size_t tfd_sz = priv->hw_params.tfd_size * TFD_QUEUE_SIZE_MAX; | ||
281 | 282 | ||
282 | /* Driver private data, only for Tx (not command) queues, | 283 | /* Driver private data, only for Tx (not command) queues, |
283 | * not shared with device. */ | 284 | * not shared with device. */ |
@@ -289,18 +290,16 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv, | |||
289 | "structures failed\n"); | 290 | "structures failed\n"); |
290 | goto error; | 291 | goto error; |
291 | } | 292 | } |
292 | } else | 293 | } else { |
293 | txq->txb = NULL; | 294 | txq->txb = NULL; |
295 | } | ||
294 | 296 | ||
295 | /* Circular buffer of transmit frame descriptors (TFDs), | 297 | /* Circular buffer of transmit frame descriptors (TFDs), |
296 | * shared with device */ | 298 | * shared with device */ |
297 | txq->tfds = pci_alloc_consistent(dev, | 299 | txq->tfds = pci_alloc_consistent(dev, tfd_sz, &txq->q.dma_addr); |
298 | priv->hw_params.tfd_size * TFD_QUEUE_SIZE_MAX, | ||
299 | &txq->q.dma_addr); | ||
300 | 300 | ||
301 | if (!txq->tfds) { | 301 | if (!txq->tfds) { |
302 | IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n", | 302 | IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n", tfd_sz); |
303 | priv->hw_params.tfd_size * TFD_QUEUE_SIZE_MAX); | ||
304 | goto error; | 303 | goto error; |
305 | } | 304 | } |
306 | txq->q.id = id; | 305 | txq->q.id = id; |