From: Larry Finger <Larry.Finger@lwfinger.net>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
Larry Finger <Larry.Finger@lwfinger.net>,
netdev@vger.kernel.org
Subject: [PATCH 3.8 2/5 V2] rtlwifi: rtl8192ce: Fix warning for unchecked pci_map_single() call
Date: Thu, 27 Dec 2012 10:37:29 -0600 [thread overview]
Message-ID: <1356626252-4058-3-git-send-email-Larry.Finger@lwfinger.net> (raw)
In-Reply-To: <1356626252-4058-1-git-send-email-Larry.Finger@lwfinger.net>
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>
---
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 11 +++++++++++
1 file changed, 11 insertions(+)
No change for V2.
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 1734247..c31795e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -611,8 +611,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
dma_addr_t mapping = pci_map_single(rtlpci->pdev,
skb->data, skb->len,
PCI_DMA_TODEVICE);
+
u8 bw_40 = 0;
+ if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+ RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+ "DMA mapping error");
+ return;
+ }
rcu_read_lock();
sta = get_sta(hw, mac->vif, mac->bssid);
if (mac->opmode == NL80211_IFTYPE_STATION) {
@@ -774,6 +780,11 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
__le16 fc = hdr->frame_control;
+ if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+ RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+ "DMA mapping error");
+ return;
+ }
CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
if (firstseg)
--
1.7.10.4
next prev parent reply other threads:[~2012-12-27 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-27 16:37 [PATCH 3.8 0/5 V2] Fixes for WARNINGS due to unchecked DMA mapping calls Larry Finger
[not found] ` <1356626252-4058-1-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
2012-12-27 16:37 ` [PATCH 3.8 1/5 V2] rtlwifi: Fix warning for unchecked pci_map_single() call Larry Finger
2012-12-27 16:37 ` Larry Finger [this message]
2012-12-27 16:37 ` [PATCH 3.8 3/5 V2] rtlwifi: rtl8192de: " Larry Finger
2012-12-27 16:37 ` [PATCH 3.8 4/5 V2] rtlwifi: rtl8192se: " Larry Finger
2012-12-27 16:37 ` [PATCH 3.8 5/5 V2] rtlwifi: rtl8723ae: " Larry Finger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356626252-4058-3-git-send-email-Larry.Finger@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox