staging: rtl8188eu: refactor rtw_lps_ctrl_wk_cmd
Allocate memory only if we're asked to enqueue the command for later processing. Handle memory allocation failures in one place. There's no need to "goto exit" if we're not doing any cleanup there. kzalloc already set all of pdrvextra_cmd_parm to 0. We don't have to set pdrvextra_cmd_parm->pbuf = NULL manually. Signed-off-by:Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210605165858.3175-3-martin@kaiser.cxSigned-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment