Skip to contentSkip to conversation

staging: r8188eu: drop redundant check in _rtw_free_mlme_priv

PATCH New Vihas Makwana 1 participant 1 message Apr 27, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: r8188eu: drop redundant check in _rtw_free_mlme_priv

There's a NULL check on pmlmepriv in rtw_mlme.c:112 which makes no sense as rtw_free_mlme_priv_ie_data() dereferences it unconditionally and it would have already crashed at this point.
Remove this redundant check.

---
v2 -> v1:
drop the redundant check

 drivers/staging/r8188eu/core/rtw_mlme.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +1 -3
index 080e07385..353f3eaed 100644
@@ -248,9 +248,7 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct	mlme_priv *pmlmepriv)
 void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
 {
 	rtw_free_mlme_priv_ie_data(pmlmepriv);
-
-	if (pmlmepriv)
-		vfree(pmlmepriv->free_bss_buf);
+	vfree(pmlmepriv->free_bss_buf);
 }
 
 struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
Signature · 1 line
2.30.2