mwl8k: call pci_unmap_single() before accessing command structure again
authorLennert Buytenhek <buytenh@wantstofly.org>
Mon, 3 Aug 2009 19:58:47 +0000 (21:58 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 7 Aug 2009 17:09:30 +0000 (13:09 -0400)
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c

index 9643aa4751c94fd88c4ad6b997abd0ea0c068266..25423c05aff1f245b5dd08ba947c8d153dbb1483 100644 (file)
@@ -1593,6 +1593,9 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
        timeout = wait_for_completion_timeout(&cmd_wait,
                                msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS));
 
+       pci_unmap_single(priv->pdev, dma_addr, dma_size,
+                                       PCI_DMA_BIDIRECTIONAL);
+
        result = &cmd->result;
        if (!timeout) {
                spin_lock_irq(&priv->fw_lock);
@@ -1612,8 +1615,6 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
                               *result);
        }
 
-       pci_unmap_single(priv->pdev, dma_addr, dma_size,
-                                       PCI_DMA_BIDIRECTIONAL);
        return rc;
 }