staging: rtl8723bs: avoid null pointer dereference on pmlmepriv
There is a check to see if pmlmepriv is null before vfree'ing pmlmepriv->free_bss_buf hence implying pmlmepriv could potenially be null. However, a previous call to rtw_free_mlme_priv_ie_data can also dereference pmlmepriv, so move this call so that it is only called if pmlmepriv non-null. Detected by CoverityScan, CID#1077739 ("Dereference before null check") Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c51b46dd5b
commit
ec14121931
@ -119,9 +119,8 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
|
||||
|
||||
void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
rtw_free_mlme_priv_ie_data(pmlmepriv);
|
||||
|
||||
if (pmlmepriv) {
|
||||
rtw_free_mlme_priv_ie_data(pmlmepriv);
|
||||
if (pmlmepriv->free_bss_buf) {
|
||||
vfree(pmlmepriv->free_bss_buf);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user