staging: rtl8723bs: core: rtw_cmd: drop unneeded null test
authorJulia Lawall <julia.lawall@lip6.fr>
Sat, 8 Apr 2017 17:14:08 +0000 (19:14 +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_ap.c

index 68b750275dffc219ff0bf383ca4e8bb70803f377..d3007c1c45e3723fe0678cdeb5c50857ee5c6bcd 100644 (file)
@@ -1855,8 +1855,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
                pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen;
        }
 
-       if (pbackup_remainder_ie)
-               kfree(pbackup_remainder_ie);
+       kfree(pbackup_remainder_ie);
 
        /*  deal with the case without set_tx_beacon_cmd() in update_beacon() */
 #if defined(CONFIG_INTERRUPT_BASED_TXBCN)