mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
staging: rtl8723bs: cleanup NULL check before vfree
Remove redundant NULL pointer check before vfree() since vfree() does its own NULL check. Reported by coccinelle. Signed-off-by: Amarjargal Gundjalam <amarjargal16@gmail.com> Link: https://lore.kernel.org/r/20201026141510.GA21791@AJ-T14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9ab476ba00
commit
90855921ac
4 changed files with 8 additions and 15 deletions
|
@ -112,8 +112,7 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
|
|||
{
|
||||
if (pmlmepriv) {
|
||||
rtw_free_mlme_priv_ie_data(pmlmepriv);
|
||||
if (pmlmepriv->free_bss_buf)
|
||||
vfree(pmlmepriv->free_bss_buf);
|
||||
vfree(pmlmepriv->free_bss_buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,7 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv)
|
|||
|
||||
rtw_os_recv_resource_free(precvpriv);
|
||||
|
||||
if (precvpriv->pallocated_frame_buf)
|
||||
vfree(precvpriv->pallocated_frame_buf);
|
||||
vfree(precvpriv->pallocated_frame_buf);
|
||||
|
||||
rtw_hal_free_recv_priv(padapter);
|
||||
}
|
||||
|
|
|
@ -177,8 +177,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
|||
|
||||
kfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if (pstapriv->pallocated_stainfo_buf)
|
||||
vfree(pstapriv->pallocated_stainfo_buf);
|
||||
vfree(pstapriv->pallocated_stainfo_buf);
|
||||
|
||||
}
|
||||
return _SUCCESS;
|
||||
|
|
|
@ -290,11 +290,8 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
|||
pxmitbuf++;
|
||||
}
|
||||
|
||||
if (pxmitpriv->pallocated_frame_buf)
|
||||
vfree(pxmitpriv->pallocated_frame_buf);
|
||||
|
||||
if (pxmitpriv->pallocated_xmitbuf)
|
||||
vfree(pxmitpriv->pallocated_xmitbuf);
|
||||
vfree(pxmitpriv->pallocated_frame_buf);
|
||||
vfree(pxmitpriv->pallocated_xmitbuf);
|
||||
|
||||
/* free xframe_ext queue, the same count as extbuf */
|
||||
pxmitframe = (struct xmit_frame *)pxmitpriv->xframe_ext;
|
||||
|
@ -304,8 +301,8 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
|||
pxmitframe++;
|
||||
}
|
||||
}
|
||||
if (pxmitpriv->xframe_ext_alloc_addr)
|
||||
vfree(pxmitpriv->xframe_ext_alloc_addr);
|
||||
|
||||
vfree(pxmitpriv->xframe_ext_alloc_addr);
|
||||
|
||||
/* free xmit extension buff */
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
|
||||
|
@ -315,8 +312,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
|||
pxmitbuf++;
|
||||
}
|
||||
|
||||
if (pxmitpriv->pallocated_xmit_extbuf)
|
||||
vfree(pxmitpriv->pallocated_xmit_extbuf);
|
||||
vfree(pxmitpriv->pallocated_xmit_extbuf);
|
||||
|
||||
for (i = 0; i < CMDBUF_MAX; i++) {
|
||||
pxmitbuf = &pxmitpriv->pcmd_xmitbuf[i];
|
||||
|
|
Loading…
Reference in a new issue