Skip to contentSkip to conversation

staging: rtl8723bs: Remove unnecessary null check

PATCH New YueHaibing 1 participant 1 message Oct 10, 2019 Staging

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 staging: rtl8723bs: Remove unnecessary null check

Null check before kfree is redundant, so remove it. This is detected by coccinelle.

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index 5044f73..74b097a 100644
@@ -1141,8 +1141,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)
Signature · 1 line
2.7.4