X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fcryptd.c;h=b150de562057f59bd85a69f0bb4e3267589c6bff;hb=516c8be3a93ec2b0746ba0907f38c1d1e62f4992;hp=250425263e00e59fad2b5a11436ce5a02b9dbe41;hpb=e5a9e8e6890d9b9c7a0f25b03ffdaf28614a9a4c;p=linux-2.6 diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 250425263e..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,