From: Julia Lawall Date: Sat, 8 Apr 2017 17:12:27 +0000 (+0200) Subject: staging: rtl8723bs: core: rtw_cmd: drop unneeded null tests X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6cb3d05f3030deed157c9bbada5c58e7ee0f5172;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723bs: core: rtw_cmd: drop unneeded null tests kfree returns immediately on NULL so the tests are not needed. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Hans de Goede Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 475ed38505af..24ba0533572e 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -248,11 +248,9 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv) void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { if (pcmdpriv) { - if (pcmdpriv->cmd_allocated_buf) - kfree(pcmdpriv->cmd_allocated_buf); + kfree(pcmdpriv->cmd_allocated_buf); - if (pcmdpriv->rsp_allocated_buf) - kfree(pcmdpriv->rsp_allocated_buf); + kfree(pcmdpriv->rsp_allocated_buf); mutex_destroy(&pcmdpriv->sctx_mutex); }