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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 15 Feb 2017 14:57:00 +0800
From:   maomao xu <albert008.xu@...il.com>
To:     gregkh@...uxfoundation.org, singhalsimran0@...il.com,
        colin@...dal.org, albert008.xu@...il.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8192u: Fix sparse warnings about endianness

drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:175:36: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:175:36:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:175:36:    got restricted __be16 [usertype] <noident>

Signed-off-by: maomao xu <albert008.xu@...il.com>

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 949c496..a1da90a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -172,7 +172,7 @@ static inline int ieee80211_put_snap(u8 *data, u16 h_proto)
 	snap->oui[1] = oui[1];
 	snap->oui[2] = oui[2];
 
-	*(u16 *)(data + SNAP_SIZE) = htons(h_proto);
+	put_unaligned_be16(h_proto, data + SNAP_SIZE);
 
 	return SNAP_SIZE + sizeof(u16);
 }
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ