WSL2-Linux-Kernel/drivers/staging/rtl8723bs
Xiaoke Wang 39bef9c6a9 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-26 12:35:50 +02:00
..
core staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv() 2022-10-26 12:35:50 +02:00
hal staging: rtl8723bs: Fix access-point mode deadlock 2022-03-16 14:23:42 +01:00
include staging: rtl8723bs: remove header file ethernet.h 2021-08-26 12:14:57 +02:00
os_dep staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw() 2022-10-26 12:35:50 +02:00
Kconfig staging: rtl8723bs: remove obsolete wext support 2021-08-26 12:13:01 +02:00
Makefile staging: rtl8723bs: remove empty files 2021-08-10 12:12:19 +02:00
TODO