From 38b3da6d003be91ca57791e45b6b45d37290b5da Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Sat, 19 Mar 2022 00:42:30 +0800 Subject: [PATCH] sched/module: correct the check condition Signed-off-by: chao.an --- sched/module/mod_insmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c index 38a5b0be96a..82c0a27c2e6 100644 --- a/sched/module/mod_insmod.c +++ b/sched/module/mod_insmod.c @@ -192,9 +192,9 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname) /* Allocate a module registry entry to hold the module data */ modp = (FAR struct module_s *)kmm_zalloc(sizeof(struct module_s)); - if (ret != 0) + if (modp == NULL) { - binfo("Failed to initialize for load of ELF program: %d\n", ret); + berr("Failed to allocate struct module_s\n"); goto errout_with_loadinfo; }