Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 7b464c9fa5cc ("staging: r8188eu: Add files for new driver - part 4")
Co-developed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200728072153.9202-1-dinghao.liu@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dinghao Liu and committed by
Greg Kroah-Hartman
11536442 53754e43

+3 -1
+3 -1
drivers/staging/rtl8188eu/core/rtw_mlme.c
··· 1729 1729 if ((ndisauthmode == Ndis802_11AuthModeWPA) || 1730 1730 (ndisauthmode == Ndis802_11AuthModeWPAPSK)) 1731 1731 authmode = _WPA_IE_ID_; 1732 - if ((ndisauthmode == Ndis802_11AuthModeWPA2) || 1732 + else if ((ndisauthmode == Ndis802_11AuthModeWPA2) || 1733 1733 (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) 1734 1734 authmode = _WPA2_IE_ID_; 1735 + else 1736 + authmode = 0x0; 1735 1737 1736 1738 if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { 1737 1739 memcpy(out_ie + ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);