diff --git a/include/zephyr/llext/llext.h b/include/zephyr/llext/llext.h index af215e6acc0..b10ba2468ae 100644 --- a/include/zephyr/llext/llext.h +++ b/include/zephyr/llext/llext.h @@ -121,7 +121,7 @@ struct llext_load_param { * * @param[in] loader An extension loader that provides input data and context * @param[in] name A string identifier for the extension - * @param[out] ext A pointer to a statically allocated llext struct + * @param[out] ext This will hold the pointer to the llext struct * @param[in] ldr_parm Loader parameters * * @retval 0 Success diff --git a/subsys/llext/llext.c b/subsys/llext/llext.c index 77a741f0636..80d83dbb152 100644 --- a/subsys/llext/llext.c +++ b/subsys/llext/llext.c @@ -894,6 +894,8 @@ int llext_load(struct llext_loader *ldr, const char *name, struct llext **ext, int ret; elf_ehdr_t ehdr; + *ext = llext_by_name(name); + k_mutex_lock(&llext_lock, K_FOREVER); if (*ext) {