From 304d72ed00f457166d82dae9fceee8d04b25b2a7 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Fri, 4 Jun 2021 10:51:26 +0900 Subject: [PATCH] binfmt: Call up_module_text_free() in unload_module() Summary: - I noticed that up_module_text_free() is not called if CONFIG_ARCH_USE_MODULE_TEXT=y - This commit fixes this issue Impact: - None Testing: - Tested with spresense Signed-off-by: Masayuki Ishikawa --- binfmt/binfmt_unloadmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binfmt/binfmt_unloadmodule.c b/binfmt/binfmt_unloadmodule.c index 323e3c62806..01ba6d0738c 100644 --- a/binfmt/binfmt_unloadmodule.c +++ b/binfmt/binfmt_unloadmodule.c @@ -166,7 +166,11 @@ int unload_module(FAR struct binary_s *binp) if (binp->alloc[i]) { binfo("Freeing alloc[%d]: %p\n", i, binp->alloc[i]); +#if defined(CONFIG_ARCH_USE_MODULE_TEXT) + up_module_text_free((FAR void *)binp->alloc[i]); +#else kumm_free((FAR void *)binp->alloc[i]); +#endif } }