From: Julia Lawall <julia@diku.dk>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [revised PATCH] crypto: Correct kzalloc error test
Date: Tue, 29 Apr 2008 16:18:08 +0200 (MEST) [thread overview]
Message-ID: <Pine.LNX.4.58.0804291617210.1185@pc-041.diku.dk> (raw)
In-Reply-To: <E1JqqUc-0005Rg-00@gondolin.me.apana.org.au>
From: Julia Lawall <julia@diku.dk>
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>
---
diff -u -p a/crypto/cryptd.c b/crypto/cryptd.c
--- a/crypto/cryptd.c 2008-04-16 13:27:56.000000000 +0200
+++ b/crypto/cryptd.c 2008-04-29 16:13:10.000000000 +0200
@@ -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,
next prev parent reply other threads:[~2008-04-29 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-29 13:38 [PATCH] " Julia Lawall
2008-04-29 14:07 ` Herbert Xu
2008-04-29 14:18 ` Julia Lawall [this message]
2008-04-29 16:27 ` [revised PATCH] " Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0804291617210.1185@pc-041.diku.dk \
--to=julia@diku.dk \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®