Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 1868755c authored by Vihas Makwana's avatar Vihas Makwana Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: proper error handling in rtw_init_drv_sw

The code inside rtw_init_drv_sw() calls various init functions to
populate the padapter structure and checks for their return values
respectively.
But if one of the functions in middle fails then it simply returns
_FAIL instead of proper logging and calling freeing counterparts
of previous init functions.
This leads to various memory leaks and can be found in
/sys/kernel/debug/kmemleak if kernel is compiled with DEBUG_KMEMLEAK=y.

Fix this and keep the success and error separate.

Fixes: 2b42bd58

 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: default avatarVihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220309205047.45981-3-makvihas@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 57a42b4d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment