staging: rtl8723bs: Remove unnecessary null check
authorYueHaibing <yuehaibing@huawei.com>
Thu, 10 Oct 2019 15:33:25 +0000 (23:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 09:05:59 +0000 (11:05 +0200)
Null check before kfree is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191010153325.16836-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/os_intfs.c

index cb4c86728d2640441527880f61e9025d026a7bce..47e984d5b7cba9f4ebe051a7ae43a9336662da4b 100644 (file)
@@ -1121,8 +1121,7 @@ void rtw_ndev_destructor(struct net_device *ndev)
 {
        DBG_871X(FUNC_NDEV_FMT "\n", FUNC_NDEV_ARG(ndev));
 
-       if (ndev->ieee80211_ptr)
-               kfree(ndev->ieee80211_ptr);
+       kfree(ndev->ieee80211_ptr);
 }
 
 void rtw_dev_unload(struct adapter *padapter)