aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/iowpa.h
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-01-14 01:29:17 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 13:08:32 -0800
commit1ee4c55fc9620451b2a825d793042a7e0775391b (patch)
tree7d1d6688d96c6c0b12699a24e8ffce843cfb09db /drivers/staging/vt6656/iowpa.h
parentstaging: zram: fix invalid memory references during disk write (diff)
downloadlinux-dev-1ee4c55fc9620451b2a825d793042a7e0775391b.tar.xz
linux-dev-1ee4c55fc9620451b2a825d793042a7e0775391b.zip
staging: vt6656: Fix inconsistent structure packing
vt6656 has several headers that use the #pragma pack(1) directive to enable structure packing, but never disable it. The layout of structures defined in other headers can then depend on which order the various headers are included in, breaking the One Definition Rule. In practice this resulted in crashes on x86_64 until the order of header inclusion was changed for some files in commit 11d404cb56ecd ('staging: vt6656: fix headers and add cfg80211.'). But we need a proper fix that won't be affected by future changes to the order of inclusion. This removes the #pragma pack(1) directives and adds __packed to the structure definitions for which packing appears to have been intended. Reported-and-tested-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/staging/vt6656/iowpa.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/vt6656/iowpa.h b/drivers/staging/vt6656/iowpa.h
index 959c8868f6e2..2522ddec718d 100644
--- a/drivers/staging/vt6656/iowpa.h
+++ b/drivers/staging/vt6656/iowpa.h
@@ -67,12 +67,11 @@ enum {
-#pragma pack(1)
typedef struct viawget_wpa_header {
u8 type;
u16 req_ie_len;
u16 resp_ie_len;
-} viawget_wpa_header;
+} __packed viawget_wpa_header;
struct viawget_wpa_param {
u32 cmd;
@@ -113,9 +112,8 @@ struct viawget_wpa_param {
u8 *buf;
} scan_results;
} u;
-};
+} __packed;
-#pragma pack(1)
struct viawget_scan_result {
u8 bssid[6];
u8 ssid[32];
@@ -130,7 +128,7 @@ struct viawget_scan_result {
int noise;
int level;
int maxrate;
-};
+} __packed;
/*--------------------- Export Classes ----------------------------*/