rtlwifi: fix memory leak for USB device
authorPeter Wu <peter@lekensteyn.nl>
Mon, 7 Dec 2015 00:07:31 +0000 (01:07 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 11 Dec 2015 11:48:42 +0000 (13:48 +0200)
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/realtek/rtlwifi/usb.c

index 2721cf89fb160f0d3f4e6106474c5da101707a18..aac1ed3f7bb41614bb37b274f4084652f5e2b93c 100644 (file)
@@ -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);
        }
 }