750-rtlwifi-Align-private-space-in-rtl_priv-struct.patch 1.1 KB

123456789101112131415161718192021222324252627
  1. From 60ce314d1750fef843e9db70050e09e49f838b69 Mon Sep 17 00:00:00 2001
  2. From: Larry Finger <[email protected]>
  3. Date: Thu, 19 Sep 2013 02:21:35 +0000
  4. Subject: rtlwifi: Align private space in rtl_priv struct
  5. The private array at the end of the rtl_priv struct is not aligned.
  6. On ARM architecture, this causes an alignment trap and is fixed by aligning
  7. that array with __align(sizeof(void *)). That should properly align that
  8. space according to the requirements of all architectures.
  9. Reported-by: Jason Andrews <[email protected]>
  10. Tested-by: Jason Andrews <[email protected]>
  11. Signed-off-by: Larry Finger <[email protected]>
  12. Cc: Stable <[email protected]>
  13. Signed-off-by: John W. Linville <[email protected]>
  14. ---
  15. --- a/drivers/net/wireless/rtlwifi/wifi.h
  16. +++ b/drivers/net/wireless/rtlwifi/wifi.h
  17. @@ -2057,7 +2057,7 @@ struct rtl_priv {
  18. that it points to the data allocated
  19. beyond this structure like:
  20. rtl_pci_priv or rtl_usb_priv */
  21. - u8 priv[0];
  22. + u8 priv[0] __aligned(sizeof(void *));
  23. };
  24. #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv))