summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-02-02 12:57:48 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-02-02 12:57:48 -0900
commit379520ee87b92c51f1db1e5c19379d738a7c207a (patch)
tree233f48001e4fa54d4364a1c0350a651f957545d7
parentb33fc8298f7e13226b9895abc57c9bfce5e3fa2d (diff)
Fix initialization order bug
-rw-r--r--include/linux/module.h2
-rw-r--r--linux/crypto/sha1_generic.c9
2 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 3d988c1..812aa35 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -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
diff --git a/linux/crypto/sha1_generic.c b/linux/crypto/sha1_generic.c
index b0b9cd1..31b5d12 100644
--- a/linux/crypto/sha1_generic.c
+++ b/linux/crypto/sha1_generic.c
@@ -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);