Skip to content

Commit

Permalink
crypto: algapi - Remove unneeded null check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
error27 authored and herbertx committed May 3, 2010
1 parent 9970071 commit c614e10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c614e10

Please sign in to comment.