Skip to content

Commit c614e10

Browse files
error27herbertx
authored andcommitted
crypto: algapi - Remove unneeded null check
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>
1 parent 9970071 commit c614e10

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎crypto/algapi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ int crypto_init_spawn2(struct crypto_spawn *spawn, struct crypto_alg *alg,
543543
{
544544
int err = -EINVAL;
545545

546-
if (frontend && (alg->cra_flags ^ frontend->type) & frontend->maskset)
546+
if ((alg->cra_flags ^ frontend->type) & frontend->maskset)
547547
goto out;
548548

549549
spawn->frontend = frontend;

0 commit comments

Comments
 (0)