mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] public-keys: fix warning message
@ 2025-11-21 15:17 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2025-11-21 15:17 UTC (permalink / raw)
  To: Barebox List

idr_alloc() returns the id allocated or a negative error code. Checking
for an error with if (ret) is wrong, check for < 0 instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 crypto/public-keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/public-keys.c b/crypto/public-keys.c
index 496970cc72..a2d31f4bc2 100644
--- a/crypto/public-keys.c
+++ b/crypto/public-keys.c
@@ -60,7 +60,7 @@ static int init_public_keys(void)
 
 	for (iter = __public_keys_start; iter != __public_keys_end; iter++) {
 		ret = idr_alloc(&public_keys, *iter, 0, INT_MAX, GFP_NOWAIT);
-		if (ret)
+		if (ret < 0)
 			pr_warn("error while adding key\n");
 	}
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-21 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-21 15:17 [PATCH] public-keys: fix warning message Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox