summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-03-15 21:43:29 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-03-26 21:07:26 +0200
commitb5447ff92b5169eab843a76d83e98d0cd7b7f5b6 (patch)
tree76892644681be24cece7e8a9bc7a992301420ab2 /drivers/net/wireless/ath
parentath9k: reduce listen time period (diff)
downloadlinux-b5447ff92b5169eab843a76d83e98d0cd7b7f5b6.tar.xz
linux-b5447ff92b5169eab843a76d83e98d0cd7b7f5b6.zip
ath9k: fix a memory leak in ath_rx_tasklet()
commit 0d95521ea7 (ath9k: use split rx buffers to get rid of order-1 skb allocations) added in memory leak in error path. sc->rx.frag should be cleared after the pskb_expand_head() call, or else we jump to requeue_drop_frag and leak an skb. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Jouni Malinen <jouni@qca.qualcomm.com> Cc: Felix Fietkau <nbd@openwrt.org> Cc: John W. Linville <linville@tuxdriver.com> Cc: Trond Wuellner <trond@chromium.org> Cc: Grant Grundler <grundler@chromium.org> Cc: Paul Stewart <pstew@chromium.org> Cc: David Miller <davem@davemloft.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index f4ae3ba994a8..1c4583c7ff7c 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1913,13 +1913,13 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
if (sc->rx.frag) {
int space = skb->len - skb_tailroom(hdr_skb);
- sc->rx.frag = NULL;
-
if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) {
dev_kfree_skb(skb);
goto requeue_drop_frag;
}
+ sc->rx.frag = NULL;
+
skb_copy_from_linear_data(skb, skb_put(hdr_skb, skb->len),
skb->len);
dev_kfree_skb_any(skb);