All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
@ 2021-09-27  3:30 Longji Guo
  2021-09-27  8:27 ` Hans de Goede
  2021-09-27 15:24 ` Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: Longji Guo @ 2021-09-27  3:30 UTC (permalink / raw)
  To: gregkh, fabioaiuto83
  Cc: ross.schm.dev, marcocesati, hdegoede, fmdefrancesco,
	linux-staging, linux-kernel, Longji Guo

kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree
is not necessary.

Signed-off-by: Longji Guo <guolongji@uniontech.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 375d2a742dd2..a46ab97524aa 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1344,11 +1344,9 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 			issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
 
 		spin_lock_bh(&pstat->lock);
-		if (pstat->passoc_req) {
-			kfree(pstat->passoc_req);
-			pstat->passoc_req = NULL;
-			pstat->assoc_req_len = 0;
-		}
+		kfree(pstat->passoc_req);
+		pstat->passoc_req = NULL;
+		pstat->assoc_req_len = 0;
 
 		pstat->passoc_req =  rtw_zmalloc(pkt_len);
 		if (pstat->passoc_req) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
@ 2021-09-27 11:49 Longji Guo
  2021-09-27 11:51 ` Hans de Goede
  0 siblings, 1 reply; 8+ messages in thread
From: Longji Guo @ 2021-09-27 11:49 UTC (permalink / raw)
  To: gregkh, fabioaiuto83
  Cc: ross.schm.dev, marcocesati, hdegoede, fmdefrancesco,
	linux-staging, linux-kernel, Longji Guo

kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree
is not necessary.

Signed-off-by: Longji Guo <guolongji@uniontech.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 375d2a742dd2..51390a30fa55 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1344,12 +1344,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 			issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
 
 		spin_lock_bh(&pstat->lock);
-		if (pstat->passoc_req) {
-			kfree(pstat->passoc_req);
-			pstat->passoc_req = NULL;
-			pstat->assoc_req_len = 0;
-		}
-
+		kfree(pstat->passoc_req);
+		pstat->assoc_req_len = 0;
 		pstat->passoc_req =  rtw_zmalloc(pkt_len);
 		if (pstat->passoc_req) {
 			memcpy(pstat->passoc_req, pframe, pkt_len);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
@ 2021-09-26 10:30 guolongji
  2021-09-26 11:10 ` Fabio M. De Francesco
  2021-09-26 11:21 ` Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: guolongji @ 2021-09-26 10:30 UTC (permalink / raw)
  To: gregkh, fabioaiuto83
  Cc: ross.schm.dev, marcocesati, fmdefrancesco, linux-staging,
	linux-kernel, guolongji

kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree
is not possible.

Signed-off-by: guolongji <guolongji@uniontech.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 375d2a742dd2..a46ab97524aa 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1344,11 +1344,9 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 			issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
 
 		spin_lock_bh(&pstat->lock);
-		if (pstat->passoc_req) {
-			kfree(pstat->passoc_req);
-			pstat->passoc_req = NULL;
-			pstat->assoc_req_len = 0;
-		}
+		kfree(pstat->passoc_req);
+		pstat->passoc_req = NULL;
+		pstat->assoc_req_len = 0;
 
 		pstat->passoc_req =  rtw_zmalloc(pkt_len);
 		if (pstat->passoc_req) {
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-27 15:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27  3:30 [PATCH] staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq() Longji Guo
2021-09-27  8:27 ` Hans de Goede
2021-09-27 15:24 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2021-09-27 11:49 Longji Guo
2021-09-27 11:51 ` Hans de Goede
2021-09-26 10:30 guolongji
2021-09-26 11:10 ` Fabio M. De Francesco
2021-09-26 11:21 ` Greg KH

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.