* [patch] crypto: cleanup: remove unneeded null check
@ 2010-04-28 8:55 Dan Carpenter
2010-05-03 3:08 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-04-28 8:55 UTC (permalink / raw)
To: Herbert Xu
Cc: David S. Miller, Brad Bosch, Richard Hartmann, linux-crypto,
kernel-janitors
We don't check "frontend" consistently in crypto_init_spawn2(). We
check it at the start of the function but then we dereference it
unconditionally in the parameter list when we call crypto_init_spawn().
I looked at the places that call crypto_init_spawn2() and "frontend" is
always a valid pointer so I removed the check for null.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 76fae27..c3cf1a6 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -544,7 +544,7 @@ int crypto_init_spawn2(struct crypto_spawn *spawn, struct crypto_alg *alg,
{
int err = -EINVAL;
- if (frontend && (alg->cra_flags ^ frontend->type) & frontend->maskset)
+ if ((alg->cra_flags ^ frontend->type) & frontend->maskset)
goto out;
spawn->frontend = frontend;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] crypto: cleanup: remove unneeded null check
2010-04-28 8:55 [patch] crypto: cleanup: remove unneeded null check Dan Carpenter
@ 2010-05-03 3:08 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2010-05-03 3:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: David S. Miller, Brad Bosch, Richard Hartmann, linux-crypto,
kernel-janitors
On Wed, Apr 28, 2010 at 10:55:15AM +0200, Dan Carpenter wrote:
> We don't check "frontend" consistently in crypto_init_spawn2(). We
> check it at the start of the function but then we dereference it
> unconditionally in the parameter list when we call crypto_init_spawn().
>
> I looked at the places that call crypto_init_spawn2() and "frontend" is
> always a valid pointer so I removed the check for null.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Patch applied. Thanks!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-03 3:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-28 8:55 [patch] crypto: cleanup: remove unneeded null check Dan Carpenter
2010-05-03 3:08 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).