staging: vt6656: Fix inconsistent structure packing
authorBen Hutchings <ben@decadent.org.uk>
Mon, 14 Jan 2013 01:29:17 +0000 (01:29 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Feb 2013 04:33:36 +0000 (04:33 +0000)
commit01b7106d2e26dfccb97e3dc03857d3a3e933c190
tree8538c050e0b23d971d5b4bc33f3ddeac730b18e2
parent5c0ce9fed10a58f65fe2784b664e03bdeaaac650
staging: vt6656: Fix inconsistent structure packing

commit 1ee4c55fc9620451b2a825d793042a7e0775391b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2]
drivers/staging/vt6656/bssdb.h
drivers/staging/vt6656/int.h
drivers/staging/vt6656/iocmd.h
drivers/staging/vt6656/iowpa.h