]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - crypto/cbc.c
Merge tag 'riscv-for-linus-5.6-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / crypto / cbc.c
index dd96bcf4d4b6255831df54098df1c3022cf7b4a2..e6f6273a7d3990589e2d6917a100e0204e7ad1ee 100644 (file)
@@ -54,10 +54,12 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
        struct crypto_alg *alg;
        int err;
 
-       inst = skcipher_alloc_instance_simple(tmpl, tb, &alg);
+       inst = skcipher_alloc_instance_simple(tmpl, tb);
        if (IS_ERR(inst))
                return PTR_ERR(inst);
 
+       alg = skcipher_ialg_simple(inst);
+
        err = -EINVAL;
        if (!is_power_of_2(alg->cra_blocksize))
                goto out_free_inst;
@@ -66,14 +68,11 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
        inst->alg.decrypt = crypto_cbc_decrypt;
 
        err = skcipher_register_instance(tmpl, inst);
-       if (err)
-               goto out_free_inst;
-       goto out_put_alg;
-
+       if (err) {
 out_free_inst:
-       inst->free(inst);
-out_put_alg:
-       crypto_mod_put(alg);
+               inst->free(inst);
+       }
+
        return err;
 }