lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260116160914.88069-5-william.hansen.baird@gmail.com>
Date: Fri, 16 Jan 2026 11:08:51 -0500
From: William Hansen-Baird <william.hansen.baird@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	William Hansen-Baird <william.hansen.baird@...il.com>
Subject: [PATCH 5/5] staging: rtl8723bs: core/rtw_mlme_ext.c: initialize copy_len, clearing later control-flow.

Initialize copy_len to 0 in rtw_parse_assoc_security_ies function.
This allows later if-statement to not have to explicitly set copy_len to 0.
Thus we can make the if statement single-lined, and remove the braces
from the if-else branch.
The change is purely cosmetic and changes no logic.

Signed-off-by: William Hansen-Baird <william.hansen.baird@...il.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 842e95e1eaec..d470725a033f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -946,6 +946,7 @@ static unsigned short rtw_parse_assoc_security_ies(struct adapter *padapter,
 	pstat->wpa_pairwise_cipher = 0;
 	pstat->wpa2_pairwise_cipher = 0;
 	memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie));
+
 	if ((psecuritypriv->wpa_psk & BIT(1)) && elems->rsn_ie) {
 
 		int group_cipher = 0, pairwise_cipher = 0;
@@ -1016,17 +1017,15 @@ static unsigned short rtw_parse_assoc_security_ies(struct adapter *padapter,
 		}
 
 	} else {
-		int copy_len;
+		int copy_len = 0;
 
 		if (psecuritypriv->wpa_psk == 0) 
 			return WLAN_STATUS_INVALID_IE;
 
-		if (elems->wps_ie) {
+		if (elems->wps_ie)
 			pstat->flags |= WLAN_STA_WPS;
-			copy_len = 0;
-		} else {
+		else
 			copy_len = min_t(int, sizeof(pstat->wpa_ie), wpa_ie_len+2);
-		}
 
 		if (copy_len > 0)
 			memcpy(pstat->wpa_ie, wpa_ie-2, copy_len);
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ