Skip to content

Commit 1153644

Browse files
dinghaoliugregkh
authored andcommitted
Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode
The variable authmode can be uninitialized. The danger would be if it equals to _WPA_IE_ID_ (0xdd) or _WPA2_IE_ID_ (0x33). We can avoid this by setting it to zero instead. This is the approach that was used in the rtl8723bs driver. Fixes: 7b464c9 ("staging: r8188eu: Add files for new driver - part 4") Co-developed-by: Dan Carpenter <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Dinghao Liu <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 53754e4 commit 1153644

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/staging/rtl8188eu/core/rtw_mlme.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,9 +1729,11 @@ int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
17291729
if ((ndisauthmode == Ndis802_11AuthModeWPA) ||
17301730
(ndisauthmode == Ndis802_11AuthModeWPAPSK))
17311731
authmode = _WPA_IE_ID_;
1732-
if ((ndisauthmode == Ndis802_11AuthModeWPA2) ||
1732+
else if ((ndisauthmode == Ndis802_11AuthModeWPA2) ||
17331733
(ndisauthmode == Ndis802_11AuthModeWPA2PSK))
17341734
authmode = _WPA2_IE_ID_;
1735+
else
1736+
authmode = 0x0;
17351737

17361738
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
17371739
memcpy(out_ie + ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);

0 commit comments

Comments
 (0)