From: Jes Sorensen Date: Mon, 19 May 2014 08:08:19 +0000 (+0200) Subject: staging: rtl8188eu: Do not byteswap half initialized variable X-Git-Tag: firefly_0821_release~176^2~3465^2~39^2~382 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d6c455ac1e50d0c2e377aaeae42f62833c771b2b;p=firefly-linux-kernel-4.4.55.git staging: rtl8188eu: Do not byteswap half initialized variable Copying 16 bits into an uninitialized 32 bit stack variable and then byteswapping it can provide 'interesting' results. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index e854732478b8..f5b49f351a6a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -6551,7 +6551,6 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - __le32 le32_tmp; len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); @@ -6665,8 +6664,8 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st return _SUCCESS; } - memcpy(&le32_tmp, rtw_get_beacon_interval_from_ie(bssid->IEs), 2); - bssid->Configuration.BeaconPeriod = le32_to_cpu(le32_tmp); + bssid->Configuration.BeaconPeriod = + get_unaligned_le16(rtw_get_beacon_interval_from_ie(bssid->IEs)); val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);