crypto: algapi - Remove unneeded null check
authorDan Carpenter <error27@gmail.com>
Mon, 3 May 2010 03:08:15 +0000 (11:08 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 3 May 2010 03:08:15 +0000 (11:08 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c

index 3e4524e6139bcf3b58e8f44a8de33a96e9333aee..d49d7091cecfdce027c40b4ebea4f2987ff45ef1 100644 (file)
@@ -543,7 +543,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;