summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu
diff options
context:
space:
mode:
authorBhaktipriya Shridhar2016-02-28 21:29:20 +0100
committerGreg Kroah-Hartman2016-03-12 07:09:09 +0100
commit7570ad910445d3c38bc0a5f0a82606e4861f85a6 (patch)
tree5a78b418dfb719792a0b3727374928147f53e521 /drivers/staging/rtl8188eu
parentstaging: rtl8188eu: core: Remove useless return variables (diff)
downloadkernel-qcow2-linux-7570ad910445d3c38bc0a5f0a82606e4861f85a6.tar.gz
kernel-qcow2-linux-7570ad910445d3c38bc0a5f0a82606e4861f85a6.tar.xz
kernel-qcow2-linux-7570ad910445d3c38bc0a5f0a82606e4861f85a6.zip
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>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_recv.c3
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_sta_mgt.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index d3c9ded5f023..5f53aa1cfd8a 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);
diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index d002f4a32cd6..78a9b9bf3b32 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -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;