Skip to contentSkip to conversation

Staging: rtl8188eu: core: Remove NULL test before vfree

PATCH Superseded Bhumika Goyal 2 participants 4 messages Feb 14, 2016 – Feb 15, 2016 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Staging: rtl8188eu: core: Remove NULL test before vfree

The function vfree tests whether the argument is NULL and returns immediately. So NULL test is not needed before vfree. Also remove blank line between function calls.

Changes since v1:
* Remove blank line between function calls in patch 2/2.
* Correct errors in commit messages in both the patches.
* Remove braces around if branch in 1/2.

Bhumika Goyal (2):
Staging: rtl8188eu: core: Remove NULL test before vfree
Staging: rtl8188eu: core: Remove NULL test before vfree

 drivers/staging/rtl8188eu/core/rtw_mlme.c | 6 ++----
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 7 ++-----
 2 files changed, 4 insertions(+), 9 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/2 Staging: rtl8188eu: core: Remove NULL test before vfree

The function vfree tests whether the argument is NULL and returns immediately. So NULL test before vfree is not needed. Also remove braces around if branch as they are no longer needed.

---
Changes since v1:
*Correct errors in commit message.
*Remove braces around if branch.

 drivers/staging/rtl8188eu/core/rtw_mlme.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +2 -4
index 9c2e659..a645a62 100644
@@ -122,10 +122,8 @@ void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
 {
 	rtw_free_mlme_priv_ie_data(pmlmepriv);
 
-	if (pmlmepriv) {
-		if (pmlmepriv->free_bss_buf)
-			vfree(pmlmepriv->free_bss_buf);
-	}
+	if (pmlmepriv)
+		vfree(pmlmepriv->free_bss_buf);
 }
 
 struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)
Signature · 1 line
1.9.1
#3 lore raw

PATCH v2 2/2 Staging: rtl8188eu: core: Remove NULL test before vfree

In reply to Bhumika Goyal

The function vfree tests whether the argument is NULL and returns immediately. So NULL test is not needed before vfree. Also remove blank line between function calls.

---
Changes since v1:
* Remove blank line between function calls.
* Correct errors in commit message.

 drivers/staging/rtl8188eu/core/rtw_xmit.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8188eu/core/rtw_xmit.c +2 -5
index d5ce1e2..f2dd7a6 100644
@@ -247,11 +247,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 xmit extension buff */
 	pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
Signature · 1 line
1.9.1
maintainer
#2 lore raw
In reply to Bhumika Goyal
Quoted 9 lines · Bhumika Goyal

The function vfree tests whether the argument is NULL and returns immediately. So NULL test before vfree is not needed. Also remove braces around if branch as they are no longer needed.

---
Changes since v1:
*Correct errors in commit message.
*Remove braces around if branch.

You sent 2 patches with identical subject lines, I can't take that :(

Please add the filename to the subject to make it more obvious, and unique.

thanks,

greg k-h