Commit fb322165 authored by Peter Wu's avatar Peter Wu Committed by Luis Henriques

rtlwifi: fix memory leak for USB device

commit 17bc5586 upstream.

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).
Signed-off-by: default avatarPeter Wu <peter@lekensteyn.nl>
ACKed-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
[ luis: backported to 3.16:
  - file rename: drivers/net/wireless/realtek/rtlwifi/usb.c ->
    drivers/net/wireless/rtlwifi/usb.c ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent eb43bef3
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment