crypto: algboss - remove NULL check in cryptomgr_schedule_probe()
authorRoman Smirnov <r.smirnov@omp.ru>
Mon, 1 Apr 2024 12:22:58 +0000 (15:22 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Apr 2024 07:07:51 +0000 (15:07 +0800)
The for loop will be executed at least once, so i > 0. If the loop
is interrupted before i is incremented (e.g., when checking len for NULL),
i will not be checked.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algboss.c

index 0de1e66..1aa5f30 100644 (file)
@@ -138,9 +138,6 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
                        goto err_free_param;
        }
 
-       if (!i)
-               goto err_free_param;
-
        param->tb[i + 1] = NULL;
 
        param->type.attr.rta_len = sizeof(param->type);