Skip to content

Commit e77f7c7

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 e77f7c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/library_manager/llext_manager.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ static int llext_manager_load_data_from_storage(const struct llext_loader *ldr,
114114
enum llext_mem s_region = LLEXT_MEM_COUNT;
115115
size_t s_offset = 0;
116116

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

119124
/* skip sections not in the requested region */
120125
if (s_region != region)

0 commit comments

Comments
 (0)