* [PATCH] public-keys: fix warning message
@ 2025-11-21 15:17 Sascha Hauer
2025-11-25 10:45 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [PATCH] public-keys: fix warning message
2025-11-21 15:17 [PATCH] public-keys: fix warning message Sascha Hauer
@ 2025-11-25 10:45 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-11-25 10:45 UTC (permalink / raw)
To: Barebox List, Sascha Hauer
On Fri, 21 Nov 2025 16:17:44 +0100, Sascha Hauer wrote:
> idr_alloc() returns the id allocated or a negative error code. Checking
> for an error with if (ret) is wrong, check for < 0 instead.
>
>
Applied, thanks!
[1/1] public-keys: fix warning message
https://git.pengutronix.de/cgit/barebox/commit/?id=591b47b081f0 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-25 10:45 UTC | newest]
Thread overview: 2+ messages (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
2025-11-25 10:45 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox