linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] staging: r8188eu: drop redundant check in _rtw_free_mlme_priv
@ 2022-04-27 16:57 Vihas Makwana
  0 siblings, 0 replies; only message in thread
From: Vihas Makwana @ 2022-04-27 16:57 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter, Greg Kroah-Hartman, Michael Straube
  Cc: linux-staging, linux-kernel, Dan Carpenter, Pavel Skripkin,
	Vihas Makwana

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.

Signed-off-by: Vihas Makwana <makvihas@gmail.com>
---
 v2 -> v1:
    drop the redundant check
 drivers/staging/r8188eu/core/rtw_mlme.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 080e07385..353f3eaed 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -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)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-27 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-27 16:57 [PATCH v2] staging: r8188eu: drop redundant check in _rtw_free_mlme_priv Vihas Makwana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).