diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2012-12-27 17:37:28 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-02 20:38:31 +0100 |
commit | 86bfec8d5183be4601db3cc4ffab58fceec33838 (patch) | |
tree | f40500d5563763dad04f88965a8cc1c07b9ffd3a | |
parent | p54usb: add USBIDs for two more p54usb devices (diff) | |
download | linux-86bfec8d5183be4601db3cc4ffab58fceec33838.tar.xz linux-86bfec8d5183be4601db3cc4ffab58fceec33838.zip |
rtlwifi: Fix warning for unchecked pci_map_single() call
Kernel 3.8 implements checking of all DMA mapping calls and issues
a WARNING for the first it finds that is not checked.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 3deacafdcd5e..4261e8ecc4c3 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c @@ -743,6 +743,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) done: bufferaddress = (*((dma_addr_t *)skb->cb)); + if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) + return; tmp_one = 1; rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false, HW_DESC_RXBUFF_ADDR, @@ -1115,6 +1117,10 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) PCI_DMA_FROMDEVICE); bufferaddress = (*((dma_addr_t *)skb->cb)); + if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) { + dev_kfree_skb_any(skb); + return 1; + } rtlpriv->cfg->ops->set_desc((u8 *)entry, false, HW_DESC_RXBUFF_ADDR, (u8 *)&bufferaddress); |