Merge tag 'upstream-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw...
[linux-2.6-block.git] / crypto / essiv.c
index a8befc8fb06eddcce1921f28d2422efd3293620c..808f2b3621068f6db28e7c3083f3176aeb111c09 100644 (file)
@@ -188,8 +188,7 @@ static void essiv_aead_done(struct crypto_async_request *areq, int err)
        struct aead_request *req = areq->data;
        struct essiv_aead_request_ctx *rctx = aead_request_ctx(req);
 
-       if (rctx->assoc)
-               kfree(rctx->assoc);
+       kfree(rctx->assoc);
        aead_request_complete(req, err);
 }
 
@@ -486,7 +485,7 @@ static int essiv_create(struct crypto_template *tmpl, struct rtattr **tb)
        type = algt->type & algt->mask;
 
        switch (type) {
-       case CRYPTO_ALG_TYPE_BLKCIPHER:
+       case CRYPTO_ALG_TYPE_SKCIPHER:
                skcipher_inst = kzalloc(sizeof(*skcipher_inst) +
                                        sizeof(*ictx), GFP_KERNEL);
                if (!skcipher_inst)
@@ -586,7 +585,7 @@ static int essiv_create(struct crypto_template *tmpl, struct rtattr **tb)
        base->cra_alignmask     = block_base->cra_alignmask;
        base->cra_priority      = block_base->cra_priority;
 
-       if (type == CRYPTO_ALG_TYPE_BLKCIPHER) {
+       if (type == CRYPTO_ALG_TYPE_SKCIPHER) {
                skcipher_inst->alg.setkey       = essiv_skcipher_setkey;
                skcipher_inst->alg.encrypt      = essiv_skcipher_encrypt;
                skcipher_inst->alg.decrypt      = essiv_skcipher_decrypt;
@@ -628,7 +627,7 @@ static int essiv_create(struct crypto_template *tmpl, struct rtattr **tb)
 out_free_hash:
        crypto_mod_put(_hash_alg);
 out_drop_skcipher:
-       if (type == CRYPTO_ALG_TYPE_BLKCIPHER)
+       if (type == CRYPTO_ALG_TYPE_SKCIPHER)
                crypto_drop_skcipher(&ictx->u.skcipher_spawn);
        else
                crypto_drop_aead(&ictx->u.aead_spawn);