[PATCH] crypto: algboss: remove NULL check in cryptomgr_schedule_probe()

Roman Smirnov posted 1 patch 1 year, 9 months ago
There is a newer version of this series
crypto/algboss.c | 3 ---
1 file changed, 3 deletions(-)
[PATCH] crypto: algboss: remove NULL check in cryptomgr_schedule_probe()
Posted by Roman Smirnov 1 year, 9 months ago
The variable i will never be zero, so the check can be removed.

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>
---
 crypto/algboss.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/crypto/algboss.c b/crypto/algboss.c
index 0de1e6697949..1aa5f306998a 100644
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -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);
-- 
2.34.1
Re: [PATCH] crypto: algboss: remove NULL check in cryptomgr_schedule_probe()
Posted by Herbert Xu 1 year, 8 months ago
On Wed, Mar 06, 2024 at 10:29:08AM +0300, Roman Smirnov wrote:
> The variable i will never be zero, so the check can be removed.
> 
> Found by Linux Verification Center (linuxtesting.org) with Svace.

Are you sure about this? It does not seem obvious that i cannot
be zero.  If the tool is correct you need to provide the reasoning
for it.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt