linux-stable/drivers/staging
Xiaoke Wang a5be64ff6d staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()
[ Upstream commit 708056fba7 ]

In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated
in failure, then `pcmdpriv->cmd_allocated_buf` will be not properly
released. Besides, considering there are only two error paths and the
first one can directly return, so we do not need implicitly jump to the
`exit` tag to execute the error handler.

So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error
path to release the resource and simplified the return logic of
rtw_init_cmd_priv(). As there is no proper device to test with, no runtime
testing was performed.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_2B7931B79BA38E22205C5A09EFDF11E48805@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-24 09:58:27 +02:00
..
axis-fifo
board
clocking-wizard
emxx_udc
fbtft staging: fbtft: core: set smem_len before fb_deferred_io_init call 2022-08-17 15:15:38 +02:00
fieldbus staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() 2022-04-22 16:48:31 +02:00
fwserial
gdm724x Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
greybus staging: greybus: audio_helper: remove unused and wrong debugfs usage 2022-10-24 09:56:59 +02:00
iio staging: iio: ad2s1210: remove redundant assignment to variable negative 2022-04-28 19:22:56 +01:00
ks7010 staging: ks7010: remove null check after call container_of() 2022-05-19 17:42:41 +02:00
media media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start() 2022-10-24 09:57:50 +02:00
most staging/most, dim2: convert dim2_tasklet to threaded irq 2022-04-12 15:53:50 +02:00
nvec
octeon
octeon-usb
olpc_dcon staging: olpc_dcon: mark driver as broken 2022-06-10 09:09:47 +02:00
pi433 Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
qlge staging: qlge: add blank line after function declaration 2022-04-20 18:40:04 +02:00
r8188eu staging: r8188eu: add firmware dependency 2022-09-08 11:24:01 +02:00
rtl8192e staging: rtl8192e: remove null check after call container_of() 2022-05-19 17:42:43 +02:00
rtl8192u staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback 2022-08-17 15:15:30 +02:00
rtl8712 staging: rtl8712: fix use after free bugs 2022-09-08 11:24:01 +02:00
rtl8723bs staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv() 2022-10-24 09:58:27 +02:00
rts5208 staging: rts5208: Convert kmap() to kmap_local_page() 2022-04-04 07:33:47 +02:00
sm750fb staging: sm750fb: Call iounmap() to free mapped bus memory 2022-04-04 07:33:49 +02:00
vc04_services staging: vc04_services: remove unused macro 2022-05-19 17:42:56 +02:00
vme_user staging: vme: Move 'vme/devices/' to 'vme_user/' 2022-04-22 16:47:29 +02:00
vt6655 staging: vt6655: fix potential memory leak 2022-10-24 09:58:25 +02:00
vt6656 staging: vt6656: Fix multiple blank lines warning 2022-04-04 07:33:45 +02:00
wlan-ng staging/wlan-ng: get the correct struct hfa384x in work callback 2022-07-01 09:58:58 +02:00
Kconfig staging: vme: Move 'vme/devices/' to 'vme_user/' 2022-04-22 16:47:29 +02:00
Makefile staging: vme: Move 'vme/devices/' to 'vme_user/' 2022-04-22 16:47:29 +02:00