Skip to content

Commit

Permalink
rtlwifi: Fix possible unaligned array in ether_addr_copy()
Browse files Browse the repository at this point in the history
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: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Larry Finger authored and John W. Linville committed Oct 8, 2014
1 parent ca14405 commit 1fca350
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 1fca350

Please sign in to comment.