[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <016d5429e5db0596a4fc8bb25b1c23ff94ff88b4.1744990405.git.abrahamadekunle50@gmail.com>
Date: Fri, 18 Apr 2025 15:41:56 +0000
From: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
To: julia.lawall@...ia.fr,
gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev,
dan.carpenter@...aro.org,
andy@...nel.org,
Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
Subject: [PATCH v6 1/2] staging: rtl8723bs: Remove duplicate NULL tests on pstat
The pstat pointer has been previously tested for NULL after being
initialized as seen from line 970-973 of the file.
The first NULL test is shown below:
pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
if (!pstat) {
status = WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA;
goto asoc_class2_error;
}
Remove the second NULL test to avoid redundancy in code.
Found by Coccinelle
Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
Reviewed-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index e74fb7d5dc37..863c188a3cfb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1323,7 +1323,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
spin_unlock_bh(&pstapriv->asoc_list_lock);
/* now the station is qualified to join our BSS... */
- if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (status == WLAN_STATUS_SUCCESS)) {
+ if ((pstat->state & WIFI_FW_ASSOC_SUCCESS) && (status == WLAN_STATUS_SUCCESS)) {
/* 1 bss_cap_update & sta_info_update */
bss_cap_update_on_sta_join(padapter, pstat);
sta_info_update(padapter, pstat);
--
2.34.1
Powered by blists - more mailing lists