]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Fix initialization order bug
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 2 Feb 2017 21:57:48 +0000 (12:57 -0900)
committerKent Overstreet <kent.overstreet@gmail.com>
Thu, 2 Feb 2017 21:57:48 +0000 (12:57 -0900)
include/linux/module.h
linux/crypto/sha1_generic.c

index 3d988c187ec8b30c1aba6e2839e24788f94706f1..812aa35050e58e96865c29ff30ecfc075c970bf5 100644 (file)
@@ -9,7 +9,7 @@
 struct module;
 
 #define module_init(initfn)                                    \
-       __attribute__((constructor(109)))                       \
+       __attribute__((constructor(120)))                       \
        static void __call_##initfn(void) { BUG_ON(initfn()); }
 
 #if 0
index b0b9cd15b6aeca09fccdf48a749efd2c7ba6b766..31b5d12eb5e018ee3899fb0b1fa0cc397eff765e 100644 (file)
@@ -78,15 +78,8 @@ static struct shash_alg alg = {
        }
 };
 
+__attribute__((constructor(110)))
 static int __init sha1_generic_mod_init(void)
 {
        return crypto_register_shash(&alg);
 }
-
-static void __exit sha1_generic_mod_fini(void)
-{
-       crypto_unregister_shash(&alg);
-}
-
-module_init(sha1_generic_mod_init);
-module_exit(sha1_generic_mod_fini);