Backport patch to fix memory leak in rtlwifi USB devices (rhbz 1303270)

This commit is contained in:
Josh Boyer 2016-02-04 02:18:20 -05:00
parent a6cd6b36bd
commit 6f877b5c4a
2 changed files with 45 additions and 0 deletions

View File

@ -699,6 +699,9 @@ Patch645: cfg80211-wext-fix-message-ordering.patch
#rhbz 1255325
Patch646: HID-sony-do-not-bail-out-when-the-sixaxis-refuses-th.patch
#rhbz 1303270
Patch647: rtlwifi-fix-memory-leak-for-USB-device.patch
# END OF PATCH DEFINITIONS
%endif
@ -1462,6 +1465,9 @@ ApplyPatch cfg80211-wext-fix-message-ordering.patch
#rhbz 1255325
ApplyPatch HID-sony-do-not-bail-out-when-the-sixaxis-refuses-th.patch
#rhbz 1303270
ApplyPatch rtlwifi-fix-memory-leak-for-USB-device.patch
# END OF PATCH APPLICATIONS
%endif
@ -2311,6 +2317,9 @@ fi
#
#
%changelog
* Tue Feb 02 2016 Josh Boyer <jwboyer@fedoraproject.org>
- Backport patch to fix memory leak in rtlwifi USB devices (rhbz 1303270)
* Sun Jan 31 2016 Josh Boyer <jwboyer@fedoraproject.org> - 4.3.5-200
- Linux v4.3.5

View File

@ -0,0 +1,36 @@
From 17bc55864f81dd730d05f09b1641312a7990d636 Mon Sep 17 00:00:00 2001
From: Peter Wu <peter@lekensteyn.nl>
Date: Mon, 7 Dec 2015 01:07:31 +0100
Subject: [PATCH] rtlwifi: fix memory leak for USB device
Free skb for received frames with a wrong checksum. This can happen
pretty rapidly, exhausting all memory.
This fixes a memleak (detected with kmemleak). Originally found while
using monitor mode, but it also appears during managed mode (once the
link is up).
Cc: stable@vger.kernel.org
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
drivers/net/wireless/rtlwifi/usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 2721cf8..aac1ed3 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -531,6 +531,8 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
ieee80211_rx(hw, skb);
else
dev_kfree_skb_any(skb);
+ } else {
+ dev_kfree_skb_any(skb);
}
}
--
2.5.0