aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/pcrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/pcrypt.c')
-rw-r--r--crypto/pcrypt.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 247178cb98ec..71ae2b2ae33b 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -385,6 +385,7 @@ static struct crypto_template pcrypt_tmpl = {
385 385
386static int __init pcrypt_init(void) 386static int __init pcrypt_init(void)
387{ 387{
388 int err = -ENOMEM;
388 encwq = create_workqueue("pencrypt"); 389 encwq = create_workqueue("pencrypt");
389 if (!encwq) 390 if (!encwq)
390 goto err; 391 goto err;
@@ -400,14 +401,22 @@ static int __init pcrypt_init(void)
400 401
401 pcrypt_dec_padata = padata_alloc(cpu_possible_mask, decwq); 402 pcrypt_dec_padata = padata_alloc(cpu_possible_mask, decwq);
402 if (!pcrypt_dec_padata) 403 if (!pcrypt_dec_padata)
403 goto err_free_padata; 404 goto err_free_enc_padata;
404 405
405 padata_start(pcrypt_enc_padata); 406 err = padata_start(pcrypt_enc_padata);
406 padata_start(pcrypt_dec_padata); 407 if (err)
408 goto err_free_dec_padata;
409
410 err = padata_start(pcrypt_dec_padata);
411 if (err)
412 goto err_free_dec_padata;
407 413
408 return crypto_register_template(&pcrypt_tmpl); 414 return crypto_register_template(&pcrypt_tmpl);
409 415
410err_free_padata: 416err_free_dec_padata:
417 padata_free(pcrypt_dec_padata);
418
419err_free_enc_padata:
411 padata_free(pcrypt_enc_padata); 420 padata_free(pcrypt_enc_padata);
412 421
413err_destroy_decwq: 422err_destroy_decwq:
@@ -417,7 +426,7 @@ err_destroy_encwq:
417 destroy_workqueue(encwq); 426 destroy_workqueue(encwq);
418 427
419err: 428err:
420 return -ENOMEM; 429 return err;
421} 430}
422 431
423static void __exit pcrypt_exit(void) 432static void __exit pcrypt_exit(void)