diff options
author | Julia Lawall <julia@diku.dk> | 2008-04-30 00:27:14 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-05-01 18:22:28 +0800 |
commit | b1145ce395f7785487c128fe8faf8624e6586d84 (patch) | |
tree | 3700e861a1cd2f2152408a84e72ad1688875bfa5 | |
parent | 46f8153cc59384eb09a426d044668d4801f818ce (diff) |
[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>
-rw-r--r-- | crypto/cryptd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 250425263e0..b150de56205 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, |