diff options
Diffstat (limited to 'crypto/algboss.c')
-rw-r--r-- | crypto/algboss.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/algboss.c b/crypto/algboss.c index 769219b29309..76fc0b23fc6c 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c | |||
@@ -45,10 +45,9 @@ struct cryptomgr_param { | |||
45 | } nu32; | 45 | } nu32; |
46 | } attrs[CRYPTO_MAX_ATTRS]; | 46 | } attrs[CRYPTO_MAX_ATTRS]; |
47 | 47 | ||
48 | char larval[CRYPTO_MAX_ALG_NAME]; | ||
49 | char template[CRYPTO_MAX_ALG_NAME]; | 48 | char template[CRYPTO_MAX_ALG_NAME]; |
50 | 49 | ||
51 | struct completion *completion; | 50 | struct crypto_larval *larval; |
52 | 51 | ||
53 | u32 otype; | 52 | u32 otype; |
54 | u32 omask; | 53 | u32 omask; |
@@ -87,7 +86,8 @@ static int cryptomgr_probe(void *data) | |||
87 | crypto_tmpl_put(tmpl); | 86 | crypto_tmpl_put(tmpl); |
88 | 87 | ||
89 | out: | 88 | out: |
90 | complete_all(param->completion); | 89 | complete_all(¶m->larval->completion); |
90 | crypto_alg_put(¶m->larval->alg); | ||
91 | kfree(param); | 91 | kfree(param); |
92 | module_put_and_exit(0); | 92 | module_put_and_exit(0); |
93 | } | 93 | } |
@@ -187,18 +187,19 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) | |||
187 | param->otype = larval->alg.cra_flags; | 187 | param->otype = larval->alg.cra_flags; |
188 | param->omask = larval->mask; | 188 | param->omask = larval->mask; |
189 | 189 | ||
190 | memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME); | 190 | crypto_alg_get(&larval->alg); |
191 | 191 | param->larval = larval; | |
192 | param->completion = &larval->completion; | ||
193 | 192 | ||
194 | thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe"); | 193 | thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe"); |
195 | if (IS_ERR(thread)) | 194 | if (IS_ERR(thread)) |
196 | goto err_free_param; | 195 | goto err_put_larval; |
197 | 196 | ||
198 | wait_for_completion_interruptible(&larval->completion); | 197 | wait_for_completion_interruptible(&larval->completion); |
199 | 198 | ||
200 | return NOTIFY_STOP; | 199 | return NOTIFY_STOP; |
201 | 200 | ||
201 | err_put_larval: | ||
202 | crypto_alg_put(&larval->alg); | ||
202 | err_free_param: | 203 | err_free_param: |
203 | kfree(param); | 204 | kfree(param); |
204 | err_put_module: | 205 | err_put_module: |