Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7570ad91 authored by Bhaktipriya Shridhar's avatar Bhaktipriya Shridhar Committed by Greg Kroah-Hartman
Browse files

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: default avatarBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 235a0103
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -116,7 +116,6 @@ 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);

	rtw_hal_free_recv_priv(padapter);
+1 −2
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ 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);
	}