summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8723bs
diff options
context:
space:
mode:
authorLongji Guo <guolongji@uniontech.com>2021-09-29 19:06:13 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-05 12:27:50 +0200
commit42bdb41d2ef84311b6699432273be6565001128b (patch)
treef383f2f738c02663088c2143de35063a21698c1e /drivers/staging/rtl8723bs
parent6649335e1f0c3482a3a86840afdb2448ceb6bff1 (diff)
staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree is not necessary. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Longji Guo <guolongji@uniontech.com> Link: https://lore.kernel.org/r/20210929110613.29979-1-guolongji@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs')
-rw-r--r--drivers/staging/rtl8723bs/core/rtw_mlme_ext.c8
1 files 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 b2c042c36777..39adec475581 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);