staging: rtl8188eu: core: Remove NULL test before vfree

vfree frees the virtually continuous memory area starting at addr.
If addr is NULL, no operation is performed. So NULL test is not needed
before vfree.

This was done using Coccinelle:

@@
expression x;
@@
-if (x != NULL)
    vfree(x);

@@
expression x;
@@

-if (x != NULL) {
vfree(x);
x = NULL;
-}

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Bhaktipriya Shridhar 2016-02-29 01:59:20 +05:30 committed by Greg Kroah-Hartman
parent 235a010362
commit 7570ad9104
2 changed files with 2 additions and 4 deletions

View file

@ -116,8 +116,7 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv)
rtw_free_uc_swdec_pending_queue(padapter);
if (precvpriv->pallocated_frame_buf)
vfree(precvpriv->pallocated_frame_buf);
vfree(precvpriv->pallocated_frame_buf);
rtw_hal_free_recv_priv(padapter);

View file

@ -172,8 +172,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
spin_unlock_bh(&pstapriv->sta_hash_lock);
/*===============================*/
if (pstapriv->pallocated_stainfo_buf)
vfree(pstapriv->pallocated_stainfo_buf);
vfree(pstapriv->pallocated_stainfo_buf);
}
return _SUCCESS;