linux/drivers/net/wireless
Colin Ian King f52688ce0d rsi: fix memory leak on buf and usb_reg_buf
[ Upstream commit d35ef8f846 ]

In the cases where len is too long, the error return path fails to
kfree allocated buffers buf and usb_reg_buf.  The simplest fix is to
perform the sanity check on len before the allocations to avoid having
to do the kfree'ing in the first place.

Detected by CoverityScan, CID#1452258,1452259 ("Resource Leak")

Fixes: 59f73e2ae1 ("rsi: check length before USB read/write register")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-12-14 09:53:07 +01:00
..
admtek License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ath License cleanup: add SPDX license identifiers to some files 2017-11-02 10:04:46 -07:00
atmel at76c50x: constify usb_device_id 2017-08-10 11:55:57 +03:00
broadcom brcmfmac: change driver unbind order of the sdio function devices 2017-12-14 09:52:58 +01:00
cisco License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel iwlwifi: mvm: enable RX offloading with TKIP and WEP 2017-12-14 09:52:58 +01:00
intersil p54: don't unregister leds when they are not initialized 2017-11-30 08:40:52 +00:00
marvell License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mediatek mt7601u: check memory allocation failure 2017-08-24 12:54:33 +03:00
quantenna License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ralink rt2x00usb: mark device removed when get ENOENT usb error 2017-11-30 08:40:44 +00:00
realtek rtlwifi: fix uninitialized rtlhal->last_suspend_sec time 2017-11-30 08:40:46 +00:00
rsi rsi: fix memory leak on buf and usb_reg_buf 2017-12-14 09:53:07 +01:00
st License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ti License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zydas License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig qtnfmac: introduce new FullMAC driver for Quantenna chipsets 2017-05-24 17:04:13 +03:00
mac80211_hwsim.c mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl() 2017-12-14 09:53:07 +01:00
mac80211_hwsim.h mac80211_hwsim: fix command documentation indentation 2017-03-06 09:21:48 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ray_cs.c ray_cs: Avoid reading past end of buffer 2017-05-22 18:27:22 +03:00
ray_cs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rayctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rndis_wlan.c Another set of patches for -next: 2017-04-28 14:41:15 -04:00
wl3501.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wl3501_cs.c wl3501_cs: fix spelling mistake: "Insupported" -> "Unsupported" 2017-07-28 18:06:31 +03:00