From 56fd85442395924ff6615307a67dd4e4e96aedd8 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Tue, 26 Nov 2024 10:26:30 +0100 Subject: [PATCH] llext: fix minor Coverity issue #434586 The check combination of "is zero" and then "less than zero" leaves open the theoretical possibility of a positive return value, which would continue on with an uinitialized 'rela'. Checking for "not zero" has the same effect and covers all situations. Signed-off-by: Luca Burelli --- subsys/llext/llext_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/llext/llext_link.c b/subsys/llext/llext_link.c index 7dacb112a00..4ad168f4f47 100644 --- a/subsys/llext/llext_link.c +++ b/subsys/llext/llext_link.c @@ -168,7 +168,7 @@ static void llext_link_plt(struct llext_loader *ldr, struct llext *ext, elf_shdr ret = llext_read(ldr, &rela, sizeof(rela)); } - if (ret < 0) { + if (ret != 0) { LOG_ERR("PLT: failed to read RELA #%u, trying to continue", i); continue; }