linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike McCormack <mikem@ring3k.org>
To: Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: [PATCH 4/5] rtlwifi: Free skb in one place
Date: Mon, 06 Jun 2011 23:12:53 +0900	[thread overview]
Message-ID: <4DECE065.1090202@ring3k.org> (raw)

Signed-off-by: Mike McCormack <mikem@ring3k.org>
---
 drivers/net/wireless/rtlwifi/pci.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index c89d6d7..b60c1ab 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -727,11 +727,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 		    (rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G) &&
 		     (ieee80211_is_beacon(fc) ||
 		     ieee80211_is_probe_resp(fc))) {
-			dev_kfree_skb_any(skb);
+			;
 		} else {
-			if (unlikely(!rtl_action_proc(hw, skb, false))) {
-				dev_kfree_skb_any(skb);
-			} else {
+			if (likely(rtl_action_proc(hw, skb, false))) {
 				struct sk_buff *uskb = NULL;
 				u8 *pdata;
 				uskb = dev_alloc_skb(skb->len + 128);
@@ -739,7 +737,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 				       &rx_status, sizeof(rx_status));
 				pdata = (u8 *)skb_put(uskb, skb->len);
 				memcpy(pdata, skb->data, skb->len);
-				dev_kfree_skb_any(skb);
 
 				ieee80211_rx_irqsafe(hw, uskb);
 			}
@@ -751,6 +748,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 			tasklet_schedule(&rtlpriv->works.ips_leave_tasklet);
 		}
 
+		dev_kfree_skb_any(skb);
 		skb = new_skb;
 
 		rtlpci->rx_ring[rx_queue_idx].rx_buf[index] = skb;
-- 
1.7.4.1



                 reply	other threads:[~2011-06-06 14:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4DECE065.1090202@ring3k.org \
    --to=mikem@ring3k.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).