Drop unnecessary wrapper _rtw_free_cmd_priv and move its logic to rtw_free_cmd_priv. Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Vihas Makwana <makvihas@xxxxxxxxx> --- drivers/staging/r8188eu/core/rtw_cmd.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c index ebe2479d1..32589e76e 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -87,14 +87,6 @@ void rtw_free_evt_priv(struct evt_priv *pevtpriv) } } -static void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) -{ - if (pcmdpriv) { - kfree(pcmdpriv->cmd_allocated_buf); - kfree(pcmdpriv->rsp_allocated_buf); - } -} - /* Calling Context: * * rtw_enqueue_cmd can only be called between kernel thread, @@ -159,7 +151,10 @@ u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { - _rtw_free_cmd_priv(pcmdpriv); + if (pcmdpriv) { + kfree(pcmdpriv->cmd_allocated_buf); + kfree(pcmdpriv->rsp_allocated_buf); + } } static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) -- 2.30.2