linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Mike McCormack <mikem@ring3k.org>
Cc: chaoming_li@realsil.com.cn, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/5] rtlwifi: Allocate new skb before modifying old
Date: Mon, 06 Jun 2011 11:55:46 -0500	[thread overview]
Message-ID: <4DED0692.3050909@lwfinger.net> (raw)
In-Reply-To: <4DECE02C.1030205@ring3k.org>

On 06/06/2011 09:11 AM, Mike McCormack wrote:
> Make sure not to modify the skb we resubmit.
>
> Signed-off-by: Mike McCormack<mikem@ring3k.org>

I think this is a bug introduced by commit a9e1286975843042480. If it is, please 
resubmit as a single patch with subject "rtlwifi: Fix case where modified skb 
could be resubmitted", or something like this. Any bug fixes will go into 3.0, 
while the enhancements will go to 3.1.

Larry

> ---
>   drivers/net/wireless/rtlwifi/pci.c |   28 +++++++++++++---------------
>   1 files changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> index fc44005..e502db0 100644
> --- a/drivers/net/wireless/rtlwifi/pci.c
> +++ b/drivers/net/wireless/rtlwifi/pci.c
> @@ -670,6 +670,19 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
>   							&rx_status,
>   							 (u8 *) pdesc, skb);
>
> +			new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
> +			if (unlikely(!new_skb)) {
> +				RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
> +					 DBG_DMESG,
> +					 ("can't alloc skb for rx\n"));
> +				goto done;
> +			}
> +
> +			pci_unmap_single(rtlpci->pdev,
> +					 *((dma_addr_t *) skb->cb),
> +					 rtlpci->rxbuffersize,
> +					 PCI_DMA_FROMDEVICE);
> +
>   			skb_put(skb, rtlpriv->cfg->ops->get_desc((u8 *) pdesc,
>   							 false,
>   							 HW_DESC_RXPKT_LEN));
> @@ -686,21 +699,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
>   			hdr = rtl_get_hdr(skb);
>   			fc = rtl_get_fc(skb);
>
> -			/* try for new buffer - if allocation fails, drop
> -			 * frame and reuse old buffer
> -			 */
> -			new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
> -			if (unlikely(!new_skb)) {
> -				RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
> -					 DBG_DMESG,
> -					 ("can't alloc skb for rx\n"));
> -				goto done;
> -			}
> -			pci_unmap_single(rtlpci->pdev,
> -					 *((dma_addr_t *) skb->cb),
> -					 rtlpci->rxbuffersize,
> -					 PCI_DMA_FROMDEVICE);
> -
>   			if (!stats.crc&&  !stats.hwerror) {
>   				memcpy(IEEE80211_SKB_RXCB(skb),&rx_status,
>   				       sizeof(rx_status));


      reply	other threads:[~2011-06-06 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 14:11 [PATCH 1/5] rtlwifi: Allocate new skb before modifying old Mike McCormack
2011-06-06 16:55 ` Larry Finger [this message]

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=4DED0692.3050909@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mikem@ring3k.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;
as well as URLs for NNTP newsgroup(s).