Patchwork [V3.8,5/5] rtlwifi: rtl8723ae: Fix warning for unchecked pci_map_single() call

login
register
mail settings
Submitter Larry Finger
Date Dec. 26, 2012, 10:08 p.m.
Message ID <1356559691-5048-6-git-send-email-Larry.Finger@lwfinger.net>
Download mbox | patch
Permalink /patch/208223/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Larry Finger - Dec. 26, 2012, 10:08 p.m.
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/rtl8723ae/trx.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
Eric Dumazet - Dec. 26, 2012, 11:13 p.m.
On Wed, 2012-12-26 at 16:08 -0600, Larry Finger wrote:
> 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/rtl8723ae/trx.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
> index 87331d8..7ddd517 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
> @@ -387,6 +387,12 @@ void rtl8723ae_tx_fill_desc(struct ieee80211_hw *hw,
>  					    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;
> +	}
> +	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
>  	if (mac->opmode == NL80211_IFTYPE_STATION) {
>  		bw_40 = mac->bw_40;
>  	} else if (mac->opmode == NL80211_IFTYPE_AP ||
> @@ -542,6 +548,12 @@ void rtl8723ae_tx_fill_cmddesc(struct ieee80211_hw *hw,
>  					    PCI_DMA_TODEVICE);
>  	__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);
>  	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
>  
>  	if (firstseg)

This seems wrong... 

CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE) doesnt need to be done
twice, does it ?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Larry Finger - Dec. 26, 2012, 11:17 p.m.
On 12/26/2012 05:13 PM, Eric Dumazet wrote:
> On Wed, 2012-12-26 at 16:08 -0600, Larry Finger wrote:
>> 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/rtl8723ae/trx.c |   12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
>> index 87331d8..7ddd517 100644
>> --- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
>> +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
>> @@ -387,6 +387,12 @@ void rtl8723ae_tx_fill_desc(struct ieee80211_hw *hw,
>>   					    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;
>> +	}
>> +	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
>>   	if (mac->opmode == NL80211_IFTYPE_STATION) {
>>   		bw_40 = mac->bw_40;
>>   	} else if (mac->opmode == NL80211_IFTYPE_AP ||
>> @@ -542,6 +548,12 @@ void rtl8723ae_tx_fill_cmddesc(struct ieee80211_hw *hw,
>>   					    PCI_DMA_TODEVICE);
>>   	__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);
>>   	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
>>
>>   	if (firstseg)
>
> This seems wrong...
>
> CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE) doesnt need to be done
> twice, does it ?

No it does not. That is a patching error

Thanks,

Larry


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
index 87331d8..7ddd517 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
@@ -387,6 +387,12 @@  void rtl8723ae_tx_fill_desc(struct ieee80211_hw *hw,
 					    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;
+	}
+	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 	if (mac->opmode == NL80211_IFTYPE_STATION) {
 		bw_40 = mac->bw_40;
 	} else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -542,6 +548,12 @@  void rtl8723ae_tx_fill_cmddesc(struct ieee80211_hw *hw,
 					    PCI_DMA_TODEVICE);
 	__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);
 	CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 
 	if (firstseg)