提交 1fca350b 编写于 作者: L Larry Finger 提交者: John W. Linville

rtlwifi: Fix possible unaligned array in ether_addr_copy()

Two macros used to copy BSSID information use ether_addr_copy(), thus
the arrays must be 2-byte aligned. In one case, the array could become
unaligned if the struct containing it were changed. Use the __unaligned(2)
attribute to retain the necessary alignment. In addition, the magic number
used to specify the size of the array is replaced by ETH_ALEN.
Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 ca14405e
......@@ -1370,7 +1370,7 @@ struct rtl_mac {
bool rdg_en;
/*AP*/
u8 bssid[6];
u8 bssid[ETH_ALEN] __aligned(2);
u32 vendor;
u8 mcs[16]; /* 16 bytes mcs for HT rates. */
u32 basic_rates; /* b/g rates */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册