X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fcryptd.c;h=b150de562057f59bd85a69f0bb4e3267589c6bff;hb=d38b149794e7444a55e741446717147e7f0467f8;hp=1a5c45b968520a9786f6da391c341a74751a081d;hpb=332f8840f7095d294f9bb066b175a100bcde214c;p=linux-2.6 diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 1a5c45b968..b150de5620 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -190,8 +190,10 @@ static struct crypto_instance *cryptd_alloc_instance(struct crypto_alg *alg, int err; inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); - if (IS_ERR(inst)) + if (!inst) { + inst = ERR_PTR(-ENOMEM); goto out; + } err = -ENAMETOOLONG; if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, @@ -230,7 +232,7 @@ static struct crypto_instance *cryptd_alloc_blkcipher( alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); + return ERR_CAST(alg); inst = cryptd_alloc_instance(alg, state); if (IS_ERR(inst)) @@ -243,6 +245,8 @@ static struct crypto_instance *cryptd_alloc_blkcipher( inst->alg.cra_ablkcipher.min_keysize = alg->cra_blkcipher.min_keysize; inst->alg.cra_ablkcipher.max_keysize = alg->cra_blkcipher.max_keysize; + inst->alg.cra_ablkcipher.geniv = alg->cra_blkcipher.geniv; + inst->alg.cra_ctxsize = sizeof(struct cryptd_blkcipher_ctx); inst->alg.cra_init = cryptd_blkcipher_init_tfm; @@ -265,7 +269,7 @@ static struct crypto_instance *cryptd_alloc(struct rtattr **tb) algt = crypto_get_attr_type(tb); if (IS_ERR(algt)) - return ERR_PTR(PTR_ERR(algt)); + return ERR_CAST(algt); switch (algt->type & algt->mask & CRYPTO_ALG_TYPE_MASK) { case CRYPTO_ALG_TYPE_BLKCIPHER: