staging: rtl8723bs: core: rtw_cmd: drop unneeded null tests
authorJulia Lawall <julia.lawall@lip6.fr>
Sat, 8 Apr 2017 17:12:27 +0000 (19:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Apr 2017 07:29:29 +0000 (09:29 +0200)
kfree returns immediately on NULL so the tests are not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

CC: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_cmd.c

index 475ed38505af393f59919513ae0cf394c52758e1..24ba0533572eabfea4869df468c3eeff796638a9 100644 (file)
@@ -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);
        }