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] rtlwifi: Avoid modifying skbs that are resubmitted
Date: Mon, 06 Jun 2011 20:35:52 -0500 [thread overview]
Message-ID: <4DED8078.8030208@lwfinger.net> (raw)
In-Reply-To: <4DED69A7.4000108@ring3k.org>
On 06/06/2011 06:58 PM, Mike McCormack wrote:
>
> In the case we fail to allocate a new skb, the old skb should
> be resubmitted unmodified.
>
> Fixes bug introduced in a9e12869758430424804.
>
> Signed-off-by: Mike McCormack<mikem@ring3k.org>
> ---
> drivers/net/wireless/rtlwifi/pci.c | 28 +++++++++++++---------------
> 1 files changed, 13 insertions(+), 15 deletions(-)
>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
John,
This patch is needed for kernel 3.0.
Larry
> 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));
prev parent reply other threads:[~2011-06-07 1:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 23:58 [PATCH] rtlwifi: Avoid modifying skbs that are resubmitted Mike McCormack
2011-06-07 1:35 ` 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=4DED8078.8030208@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).