* [PATCH 4/6] staging: rtl8188eu: core: Remove NULL test before vfree
@ 2016-02-28 19:44 Bhaktipriya Shridhar
0 siblings, 0 replies; only message in thread
From: Bhaktipriya Shridhar @ 2016-02-28 19:44 UTC (permalink / raw)
To: outreachy-kernel
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>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 40b7a30..e5a6427 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -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);
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-02-28 19:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-28 19:44 [PATCH 4/6] staging: rtl8188eu: core: Remove NULL test before vfree Bhaktipriya Shridhar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.