netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: davem@davemloft.net
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 2/4] mac80211: fix memory leak when defrag fragments
Date: Wed, 30 May 2007 14:28:58 -0400	[thread overview]
Message-ID: <20070530182858.GE3610@tuxdriver.com> (raw)
In-Reply-To: <20070530182807.GD3610@tuxdriver.com>

From: Hong Liu <hong.liu@intel.com>

We forget to free all the fragments when defraging them into one packet.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 net/mac80211/ieee80211.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 6e36df6..145604a 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -3278,8 +3278,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
 			return TXRX_DROP;
 		}
 	}
-	while ((skb = __skb_dequeue(&entry->skb_list)))
+	while ((skb = __skb_dequeue(&entry->skb_list))) {
 		memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len);
+		dev_kfree_skb(skb);
+	}
 
 	/* Complete frame has been reassembled - process it now */
 	rx->fragmented = 1;
-- 
1.5.0.6

-- 
John W. Linville
linville@tuxdriver.com

  reply	other threads:[~2007-05-30 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-30 18:25 [PATCH 0/4] mac80211 fixes for 2.6.22 John W. Linville
     [not found] ` <20070530182538.GB3610-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-05-30 18:28   ` [PATCH 1/4] mac80211: fail back to use associate from reassociate John W. Linville
2007-05-30 18:28     ` John W. Linville [this message]
     [not found]       ` <20070530182858.GE3610-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-05-30 18:29         ` [PATCH 3/4] mac80211: always set carrier status on open John W. Linville
2007-05-30 18:30           ` [PATCH 4/4] mac80211: avoid null ptr deref in ieee80211_ibss_add_sta John W. Linville
2007-05-31  8:25   ` [PATCH 0/4] mac80211 fixes for 2.6.22 David Miller

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=20070530182858.GE3610@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=linux-wireless@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).