summaryrefslogtreecommitdiff
path: root/crypto/cfb.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2018-12-07 13:59:10 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-07 13:59:10 +0800
commit946dca8fe456564373e0ff1f40c232b534e2aaef (patch)
treeb72d6bbdd31fe6b485e32a8bb56a8320aefb4737 /crypto/cfb.c
parent7a027b57f959660547779b6290a3b50ff1601980 (diff)
parente61efff4ae94f4509707a5e03f8edb6455f490e1 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge crypto tree to pick up crypto stats API revert.
Diffstat (limited to 'crypto/cfb.c')
-rw-r--r--crypto/cfb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/cfb.c b/crypto/cfb.c
index fd4e8500e121..e81e45673498 100644
--- a/crypto/cfb.c
+++ b/crypto/cfb.c
@@ -286,9 +286,8 @@ static int crypto_cfb_create(struct crypto_template *tmpl, struct rtattr **tb)
spawn = skcipher_instance_ctx(inst);
err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst),
CRYPTO_ALG_TYPE_MASK);
- crypto_mod_put(alg);
if (err)
- goto err_free_inst;
+ goto err_put_alg;
err = crypto_inst_setname(skcipher_crypto_instance(inst), "cfb", alg);
if (err)
@@ -317,12 +316,15 @@ static int crypto_cfb_create(struct crypto_template *tmpl, struct rtattr **tb)
err = skcipher_register_instance(tmpl, inst);
if (err)
goto err_drop_spawn;
+ crypto_mod_put(alg);
out:
return err;
err_drop_spawn:
crypto_drop_spawn(spawn);
+err_put_alg:
+ crypto_mod_put(alg);
err_free_inst:
kfree(inst);
goto out;