Messages in this thread Patch in this message | | | Date | Thu, 8 May 2008 10:42:28 -0700 | From | Greg KH <> | Subject | [patch 14/16] CRYPTO: cryptd: Correct kzalloc error test |
| |
2.6.25-stable review patch. If anyone has any objections, please let us know.
------------------ From: Julia Lawall <julia@diku.dk>
[CRYPTO] cryptd: Correct kzalloc error test
[ Upstream commit: b1145ce395f7785487c128fe8faf8624e6586d84 ]
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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- crypto/cryptd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -190,8 +190,10 @@ static struct crypto_instance *cryptd_al 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, --
| |