Skip to content

Commit

Permalink
module: explicitly align module_version_attribute structure
Browse files Browse the repository at this point in the history
We force particular alignment when we generate attribute structures
when generation MODULE_VERSION() data and we need to make sure that
this alignment is followed when we iterate over these structures,
otherwise we may crash on platforms whose natural alignment is not
sizeof(void *), such as m68k.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
[ There are more issues here, but the fixes are incredibly ugly - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dmitry Torokhov authored and torvalds committed Feb 21, 2011
1 parent 5fb24b8 commit 98562ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct module_version_attribute {
struct module_attribute mattr;
const char *module_name;
const char *version;
};
} __attribute__ ((__aligned__(sizeof(void *))));

struct module_kobject
{
Expand Down

0 comments on commit 98562ad

Please sign in to comment.