diff mbox

[v2] crypto: drbg - initialize in subsys_initcall

Message ID 3033189.WTiU3v3QJk@tachyon.chronox.de (mailing list archive)
State Rejected
Delegated to: Herbert Xu
Headers show

Commit Message

Stephan Mueller June 8, 2015, 12:42 p.m. UTC
When compiling the DRBG statically into the kernel, the testmgr
allocation of the DRBG may be done at a time the Jitter RNG is
not available as it is registered later. The patch changes the
initialization to be invoked in subsys_initcall.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 crypto/jitterentropy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu June 9, 2015, 2:17 p.m. UTC | #1
On Mon, Jun 08, 2015 at 02:42:50PM +0200, Stephan Mueller wrote:
> When compiling the DRBG statically into the kernel, the testmgr
> allocation of the DRBG may be done at a time the Jitter RNG is
> not available as it is registered later. The patch changes the
> initialization to be invoked in subsys_initcall.
> 
> Signed-off-by: Stephan Mueller <smueller@chronox.de>

Actually I think we won't need this patch after all because after
my callback patches we will never allocate jent in the testmgr
path.

Cheers,
Stephan Mueller June 9, 2015, 2:18 p.m. UTC | #2
Am Tuesday 09 June 2015, 22:17:43 schrieb Herbert Xu:

Hi Herbert,

>On Mon, Jun 08, 2015 at 02:42:50PM +0200, Stephan Mueller wrote:
>> When compiling the DRBG statically into the kernel, the testmgr
>> allocation of the DRBG may be done at a time the Jitter RNG is
>> not available as it is registered later. The patch changes the
>> initialization to be invoked in subsys_initcall.
>> 
>> Signed-off-by: Stephan Mueller <smueller@chronox.de>
>
>Actually I think we won't need this patch after all because after
>my callback patches we will never allocate jent in the testmgr
>path.

Agreed. Let us drop the patch.
>
>Cheers,


Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index a60147e..20dc178 100644
--- a/crypto/jitterentropy.c
+++ b/crypto/jitterentropy.c
@@ -897,7 +897,7 @@  static void __exit jent_mod_exit(void)
 	crypto_unregister_rng(&jent_alg);
 }
 
-module_init(jent_mod_init);
+subsys_initcall(jent_mod_init);
 module_exit(jent_mod_exit);
 
 MODULE_LICENSE("Dual BSD/GPL");