]> git.openfabrics.org - ~emulex/for-vlad/old/compat.git/commitdiff
compat: Fix module_init return type from void to int.
authorNicolas Cavallari <Nicolas.Cavallari@lri.fr>
Tue, 6 Mar 2012 09:55:28 +0000 (10:55 +0100)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Tue, 6 Mar 2012 17:19:43 +0000 (09:19 -0800)
086f3a1 overrode module_init to make it depend on compat, but the
overriding module_init has return type 'void', so strange things would
happen when the module loading code see that init_module() returns
positive values.  This patch makes it return the value returned by
the overriden module_init.

Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
include/linux/compat-2.6.h

index bb00cd451b99e81a03e255955dcc673892d4d620..5715ce568443d95573d1cc73b97a143d44d2e8d1 100644 (file)
@@ -27,10 +27,10 @@ void compat_dependency_symbol(void);
 
 #undef module_init
 #define module_init(initfn)                                            \
-       static void __init __init_compat(void)                          \
+       static int __init __init_compat(void)                           \
        {                                                               \
                compat_dependency_symbol();                             \
-               initfn();                                               \
+               return initfn();                                        \
        }                                                               \
        int init_module(void) __attribute__((alias("__init_compat")));