summaryrefslogtreecommitdiff
path: root/crypto/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 5a0d6a17cfd7..67cd6f87b74a 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -18,6 +18,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
+#include <linux/module.h>
#include <linux/param.h>
#include <linux/slab.h>
#include <linux/string.h>
@@ -170,6 +171,7 @@ static struct crypto_alg *crypto_alg_mod_lookup(const char *name)
{
struct crypto_alg *alg;
struct crypto_alg *larval;
+ int ok;
alg = try_then_request_module(crypto_alg_lookup(name), name);
if (alg)
@@ -179,7 +181,13 @@ static struct crypto_alg *crypto_alg_mod_lookup(const char *name)
if (!larval || !crypto_is_larval(larval))
return larval;
- if (crypto_notify(CRYPTO_MSG_ALG_REQUEST, larval) == NOTIFY_STOP)
+ ok = crypto_notify(CRYPTO_MSG_ALG_REQUEST, larval);
+ if (ok == NOTIFY_DONE) {
+ request_module("cryptomgr");
+ ok = crypto_notify(CRYPTO_MSG_ALG_REQUEST, larval);
+ }
+
+ if (ok == NOTIFY_STOP)
alg = crypto_larval_wait(larval);
else {
crypto_mod_put(larval);