aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-tx.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-10-30 17:36:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-11-02 15:39:46 -0500
commitc33de6256a07869b48830e3a26fb6942ea8c4f79 (patch)
tree0e6e52d104120b5881613e73e7472eac7ded2f56 /drivers/net/wireless/iwlwifi/iwl-tx.c
parentc2e61da29d92df864dc5eec81d774199b02d7023 (diff)
iwlwifi: unmap memory before use
Handling responses to driver originated commands include passing the original command buffer to the caller. At this time it is possible for a callback to be invoked that is passed this command buffer and thus likely to access it. We need to make sure that the memory associated with that buffer is not DMA mapped at the time. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 8ae4c9b614e7..b46967ff3806 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -1121,11 +1121,6 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id,
1121 return; 1121 return;
1122 } 1122 }
1123 1123
1124 pci_unmap_single(priv->pci_dev,
1125 pci_unmap_addr(&txq->meta[cmd_idx], mapping),
1126 pci_unmap_len(&txq->meta[cmd_idx], len),
1127 PCI_DMA_BIDIRECTIONAL);
1128
1129 for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx; 1124 for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
1130 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1125 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1131 1126
@@ -1173,6 +1168,11 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
1173 cmd = priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index]; 1168 cmd = priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index];
1174 meta = &priv->txq[IWL_CMD_QUEUE_NUM].meta[cmd_index]; 1169 meta = &priv->txq[IWL_CMD_QUEUE_NUM].meta[cmd_index];
1175 1170
1171 pci_unmap_single(priv->pci_dev,
1172 pci_unmap_addr(meta, mapping),
1173 pci_unmap_len(meta, len),
1174 PCI_DMA_BIDIRECTIONAL);
1175
1176 /* Input error checking is done when commands are added to queue. */ 1176 /* Input error checking is done when commands are added to queue. */
1177 if (meta->flags & CMD_WANT_SKB) { 1177 if (meta->flags & CMD_WANT_SKB) {
1178 meta->source->reply_page = (unsigned long)rxb_addr(rxb); 1178 meta->source->reply_page = (unsigned long)rxb_addr(rxb);