Skip to contentSkip to conversation

Staging: rtl8188eu: core: Remove NULL test before vfree

PATCH New Bhumika Goyal 1 participant 3 messages Feb 15, 2016 Staging

lore
Share & tools
lore
#0 lore raw

v3 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.
Changes since v2:
* Add file name to subject line to make it unique and more obvious.

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 v3 1/2 Staging: rtl8188eu: core: rtw_mlme.c: 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.
Changes since v2:
*Add file name to subject line.

 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
#2 lore raw

PATCH v3 2/2 Staging: rtl8188eu: core: rtw_xmit.c: 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.
Changes since v2:
*Add file name to subject line.

 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