linux/drivers/net/wireless/realtek/rtlwifi/rtl8192cu
Ping-Ke Shih 5174f1e410 rtlwifi: fix memory leak in rtl92c_set_fw_rsvdpagepkt()
This leak was found by testing the EDIMAX EW-7612 on Raspberry Pi 3B+ with
Linux 5.4-rc5 (multi_v7_defconfig + rtlwifi + kmemleak) and noticed a
single memory leak during probe:

unreferenced object 0xec13ee40 (size 176):
  comm "kworker/u8:1", pid 36, jiffies 4294939321 (age 5580.790s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<fc1bbb3e>] __netdev_alloc_skb+0x9c/0x164
    [<863dfa6e>] rtl92c_set_fw_rsvdpagepkt+0x254/0x340 [rtl8192c_common]
    [<9572be0d>] rtl92cu_set_hw_reg+0xf48/0xfa4 [rtl8192cu]
    [<116df4d8>] rtl_op_bss_info_changed+0x234/0x96c [rtlwifi]
    [<8933575f>] ieee80211_bss_info_change_notify+0xb8/0x264 [mac80211]
    [<d4061e86>] ieee80211_assoc_success+0x934/0x1798 [mac80211]
    [<e55adb56>] ieee80211_rx_mgmt_assoc_resp+0x174/0x314 [mac80211]
    [<5974629e>] ieee80211_sta_rx_queued_mgmt+0x3f4/0x7f0 [mac80211]
    [<d91091c6>] ieee80211_iface_work+0x208/0x318 [mac80211]
    [<ac5fcae4>] process_one_work+0x22c/0x564
    [<f5e6d3b6>] worker_thread+0x44/0x5d8
    [<82c7b073>] kthread+0x150/0x154
    [<b43e1b7d>] ret_from_fork+0x14/0x2c
    [<794dff30>] 0x0

It is because 8192cu doesn't implement usb_cmd_send_packet(), and this
patch just frees the skb within the function to resolve memleak problem
by now. Since 8192cu doesn't turn on fwctrl_lps that needs to download
command packet for firmware via the function, applying this patch doesn't
affect driver behavior.

Reported-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-11-06 19:57:32 +02:00
..
def.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
dm.c rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
dm.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
hw.c rtlwifi: fix memory leak in rtl92c_set_fw_rsvdpagepkt() 2019-11-06 19:57:32 +02:00
hw.h rtlwifi: rtl8192cu: Fix problems with blank lines 2019-02-28 10:30:04 +02:00
led.c rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
led.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
mac.c rtlwifi: rtl8192cu: replace _rtl92c_evm_db_to_percentage with generic version 2019-09-13 18:06:47 +03:00
mac.h rtlwifi: rtl8192cu: Fix problems with blank lines 2019-02-28 10:30:04 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy.c rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
phy.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
reg.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
rf.c rtlwifi: rtl8192cu: remove set but not used variable 'turbo_scanoff' 2019-04-26 14:58:53 +03:00
rf.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
sw.c rtlwifi: remove assignment to itself 2019-07-24 14:54:56 +03:00
sw.h rtlwifi: rtl8192cu: Replace old-style license information 2019-02-19 17:00:05 +02:00
table.c rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
table.h rtlwifi: rtl8192{c,u}: Remove CamelCase variables 2019-02-19 17:02:56 +02:00
trx.c rtlwifi: rtl8192cu: Convert inline routines to little-endian words 2019-09-03 16:32:18 +03:00
trx.h rtlwifi: rtl8192cu: Convert inline routines to little-endian words 2019-09-03 16:32:18 +03:00