staging: r8188eu: drop redundant check in _rtw_free_mlme_priv
authorVihas Makwana <makvihas@gmail.com>
Wed, 27 Apr 2022 16:57:49 +0000 (22:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 May 2022 21:19:15 +0000 (23:19 +0200)
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>
Link: https://lore.kernel.org/r/20220427165748.10584-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme.c

index a597639025170d28f7d11b5ffb0fbeeaeb9bcc3f..c44e636d2c05e2cd379999b911abe1417b9b9b47 100644 (file)
@@ -248,9 +248,7 @@ exit:
 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)