Skip to contentSkip to conversation

staging: rtl8723bs: remove an redundant null check before kfree()

PATCH In review zhong jiang 2 participants 8 messages Oct 16, 2019 – Oct 29, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: remove an redundant null check before kfree()

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4
maintainer
#1 lore raw
Quoted 25 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

#2 lore raw
Quoted 22 lines · Greg KH
Quoted 21 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
Quoted 8 lines
Quoted 4 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -0
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

.

But I do not see other mantainer take the patch so far.

Thanks,
zhong jiang

#3 lore raw
In reply to Greg KH
Quoted 22 lines · Greg KH
Quoted 21 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
Quoted 8 lines
Quoted 4 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -0
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

.

Greg, Could you apply the patch to your tree ?

Thanks,
zhong jiang

maintainer
#4 lore raw
Quoted 29 lines · zhong jiang
Quoted 28 lines · Greg KH
Quoted 25 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

Quoted 3 lines
Quoted 2 lines

.

Greg, Could you apply the patch to your tree ?

It did not apply, so what do you want me to do with it?

confused,

greg k-h

#5 lore raw
Quoted 30 lines · Greg KH
Quoted 29 lines · zhong jiang
Quoted 28 lines · Greg KH
Quoted 25 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

.

Greg, Could you apply the patch to your tree ?

It did not apply, so what do you want me to do with it?

confused,

Could you receive the patch ? :-)

Thanks,
zhong jiang

Quoted 4 lines

greg k-h

.

maintainer
#6 lore raw
Quoted 31 lines · zhong jiang
Quoted 30 lines · Greg KH
Quoted 29 lines · zhong jiang
Quoted 28 lines · Greg KH
Quoted 25 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

.

Greg, Could you apply the patch to your tree ?

It did not apply, so what do you want me to do with it?

confused,

Could you receive the patch ? :-)

The patch did not apply properly to my tree, there is no way I can apply it. Please fix it up and resend it so that I can apply it.

thanks,

greg k-h

#7 lore raw
Quoted 34 lines · Greg KH
Quoted 33 lines · zhong jiang
Quoted 32 lines · Greg KH
Quoted 31 lines · zhong jiang
Quoted 30 lines · Greg KH
Quoted 25 lines · zhong jiang

kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index 7011c2a..4597f4f 100644
@@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
 	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
Signature · 1 line
1.7.12.4

Patch does not apply to my tree :(

.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

Greg, Could you apply the patch to your tree ?

It did not apply, so what do you want me to do with it?

confused,

Could you receive the patch ? :-)

The patch did not apply properly to my tree, there is no way I can apply it. Please fix it up and resend it so that I can apply it.

I will repost it in v2, Thanks

Sincerely,
zhong jiang

Quoted 6 lines

thanks,

greg k-h

.