dect
/
linux-2.6
Archived
13
0
Fork 0

[CRYPTO] cryptd: Correct kzalloc error test

Normally, kzalloc returns NULL or a valid pointer value, not a value to be
tested using IS_ERR.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Julia Lawall 2008-04-30 00:27:14 +08:00 committed by Herbert Xu
parent 46f8153cc5
commit b1145ce395
1 changed files with 3 additions and 1 deletions

View File

@ -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,