aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/cryptomgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cryptomgr.c')
-rw-r--r--crypto/cryptomgr.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/crypto/cryptomgr.c b/crypto/cryptomgr.c
index ae54942e3b31..9b5b15601068 100644
--- a/crypto/cryptomgr.c
+++ b/crypto/cryptomgr.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/notifier.h> 18#include <linux/notifier.h>
19#include <linux/rtnetlink.h> 19#include <linux/rtnetlink.h>
20#include <linux/sched.h>
20#include <linux/string.h> 21#include <linux/string.h>
21#include <linux/workqueue.h> 22#include <linux/workqueue.h>
22 23
@@ -44,21 +45,25 @@ static void cryptomgr_probe(void *data)
44 struct cryptomgr_param *param = data; 45 struct cryptomgr_param *param = data;
45 struct crypto_template *tmpl; 46 struct crypto_template *tmpl;
46 struct crypto_instance *inst; 47 struct crypto_instance *inst;
48 int err;
47 49
48 tmpl = crypto_lookup_template(param->template); 50 tmpl = crypto_lookup_template(param->template);
49 if (!tmpl) 51 if (!tmpl)
50 goto err; 52 goto err;
51 53
52 inst = tmpl->alloc(&param->alg, sizeof(param->alg)); 54 do {
53 if (IS_ERR(inst)) 55 inst = tmpl->alloc(&param->alg, sizeof(param->alg));
54 goto err; 56 if (IS_ERR(inst))
55 else if ((err = crypto_register_instance(tmpl, inst))) { 57 err = PTR_ERR(inst);
56 tmpl->free(inst); 58 else if ((err = crypto_register_instance(tmpl, inst)))
57 goto err; 59 tmpl->free(inst);
58 } 60 } while (err == -EAGAIN && !signal_pending(current));
59 61
60 crypto_tmpl_put(tmpl); 62 crypto_tmpl_put(tmpl);
61 63
64 if (err)
65 goto err;
66
62out: 67out:
63 kfree(param); 68 kfree(param);
64 return; 69 return;