staging: rtl8188eu: refactor rtw_lps_ctrl_wk_cmd
authorMartin Kaiser <martin@kaiser.cx>
Sat, 5 Jun 2021 16:58:52 +0000 (18:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jun 2021 12:20:04 +0000 (14:20 +0200)
commitd3f3fb9810ac51b18088201c72583cd07cce0db6
treedff68f9b7b53dd2991f5c28ca651a2cad7b4618f
parentb17aad8b567f47c029430486ba0c54a3abdbd4e3
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.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c