linux/drivers/net/wireless/rsi
Colin Ian King d35ef8f846 rsi: fix memory leak on buf and usb_reg_buf
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>
2017-11-18 10:32:41 +09:00
..
Kconfig rsi: add vendor Kconfig entry 2015-11-18 14:28:31 +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
rsi_91x_core.c rsi: sdio: Add WOWLAN support for S4 hibernate state 2017-10-30 12:50:12 +02:00
rsi_91x_debugfs.c rsi: add version information 2017-09-25 11:25:23 +03:00
rsi_91x_hal.c drivers/wireless: rsi: Convert timers to use timer_setup() 2017-10-27 10:47:00 +03:00
rsi_91x_mac80211.c rsi: fix kbuild reported build errors with CONFIG_PM off 2017-11-02 19:38:14 +02:00
rsi_91x_main.c rsi: sdio: Add WOWLAN support for S4 hibernate state 2017-10-30 12:50:12 +02:00
rsi_91x_mgmt.c rsi: fix kbuild reported build errors with CONFIG_PM off 2017-11-02 19:38:14 +02:00
rsi_91x_ps.c rsi: rsi_91x_ps: remove redundant code in str_psstate 2017-11-10 04:36:10 +02:00
rsi_91x_sdio_ops.c rsi: buffer available interrupt handling 2017-08-08 14:46:03 +03:00
rsi_91x_sdio.c rsi: move rsi_sdio_reinit_device() out of CONFIG_PM 2017-11-02 19:38:14 +02:00
rsi_91x_usb_ops.c rsi: use separate mutex lock for receive thread 2017-07-28 17:22:43 +03:00
rsi_91x_usb.c rsi: fix memory leak on buf and usb_reg_buf 2017-11-18 10:32:41 +09:00
rsi_boot_params.h rsi: configure new boot parameters to device 2017-06-21 18:26:26 +03:00
rsi_common.h rsi: fix kbuild reported build errors with CONFIG_PM off 2017-11-02 19:38:14 +02:00
rsi_debugfs.h
rsi_hal.h rsi: add version information 2017-09-25 11:25:23 +03:00
rsi_main.h rsi: sdio: Add WOWLAN support for S4 hibernate state 2017-10-30 12:50:12 +02:00
rsi_mgmt.h rsi: fix kbuild reported build errors with CONFIG_PM off 2017-11-02 19:38:14 +02:00
rsi_ps.h rsi: disallow power save config when AP vap running 2017-09-20 15:38:57 +03:00
rsi_sdio.h rsi: move rsi_sdio_reinit_device() out of CONFIG_PM 2017-11-02 19:38:14 +02:00
rsi_usb.h rsi: use macro for allocating USB buffer 2017-07-28 17:27:18 +03:00