Skip to content

Commit 23eafb8

Browse files
committed
llext-manager: check llext_get_section_info() return code
llext_get_section_info() shouldn't fail when called with a valid section number, but it's still cleaner to check its success and skip the section in case of an error. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent ae06c96 commit 23eafb8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/library_manager/llext_manager.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,12 @@ static int llext_manager_load_data_from_storage(const struct llext_loader *ldr,
113113
const elf_shdr_t *shdr;
114114
enum llext_mem s_region = LLEXT_MEM_COUNT;
115115
size_t s_offset = 0;
116+
int ret = llext_get_section_info(ldr, ext, i, &shdr, &s_region, &s_offset);
116117

117-
llext_get_section_info(ldr, ext, i, &shdr, &s_region, &s_offset);
118+
if (ret < 0) {
119+
tr_err(lib_manager_tr, "no section info: %d", ret);
120+
continue;
121+
}
118122

119123
/* skip sections not in the requested region */
120124
if (s_region != region)

0 commit comments

Comments
 (0)