From e7b9eeecb3663365cd06e787a1aee97b7f7bc257 Mon Sep 17 00:00:00 2001 From: Roman Smirnov Date: Mon, 1 Apr 2024 15:22:58 +0300 Subject: crypto: algboss - remove NULL check in cryptomgr_schedule_probe() 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 Reviewed-by: Sergey Shtylyov Signed-off-by: Herbert Xu --- crypto/algboss.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'crypto/algboss.c') diff --git a/crypto/algboss.c b/crypto/algboss.c index 0de1e669..1aa5f306 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); -- cgit v1.2.3