Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>

authored by

Vihas Makwana and committed by
Greg Kroah-Hartman
3136dc60 921f9c58

+1 -3
+1 -3
drivers/staging/r8188eu/core/rtw_mlme.c
··· 248 248 void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) 249 249 { 250 250 rtw_free_mlme_priv_ie_data(pmlmepriv); 251 - 252 - if (pmlmepriv) 253 - vfree(pmlmepriv->free_bss_buf); 251 + vfree(pmlmepriv->free_bss_buf); 254 252 } 255 253 256 254 struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)