summaryrefslogtreecommitdiff
path: root/com32/lib/sys/module/exec.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-12-07 11:33:45 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-12-07 11:33:45 +0000
commit10f6cf6eef0a7da7dad1933efdbfb101155792d0 (patch)
treed8ee3bfc6e55e739e0f135cd6d945955c670dd46 /com32/lib/sys/module/exec.c
parent35928ee37da523e5f992cc462a4a4193d0bfaa4c (diff)
parentddb10ce99c327888ade4d2ba3e4c50ad12aaa059 (diff)
downloadsyslinux-6.00-pre3.tar.gz
Merge tag 'syslinux-5.00' into firmwaresyslinux-6.00-pre3
Conflicts: Makefile com32/elflink/ldlinux/Makefile com32/lib/sys/module/elf_module.c core/cleanup.c core/comboot.inc core/conio.c core/fs/fs.c core/init.c core/mem/free.c core/mem/malloc.c core/timer.inc diag/geodsp/Makefile extlinux/main.c mk/embedded.mk modules/Makefile Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/lib/sys/module/exec.c')
-rw-r--r--com32/lib/sys/module/exec.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/com32/lib/sys/module/exec.c b/com32/lib/sys/module/exec.c
index 29d0a2fd..559bafc7 100644
--- a/com32/lib/sys/module/exec.c
+++ b/com32/lib/sys/module/exec.c
@@ -194,8 +194,10 @@ int spawn_load(const char *name, int argc, char **argv)
return -1;
if (get_module_type(module) == EXEC_MODULE) {
- if (!argc || !argv || strcmp(argv[0], name))
- return -1;
+ if (!argc || !argv || strcmp(argv[0], name)) {
+ res = -1;
+ goto out;
+ }
}
if (!strcmp(cur_module->name, module->name)) {
@@ -218,10 +220,8 @@ int spawn_load(const char *name, int argc, char **argv)
}
res = module_load(module);
- if (res != 0) {
- _module_unload(module);
- return res;
- }
+ if (res != 0)
+ goto out;
type = get_module_type(module);
prev_module = cur_module;
@@ -259,14 +259,14 @@ int spawn_load(const char *name, int argc, char **argv)
cur_module = prev_module;
res = module_unload(module);
- if (res != 0) {
- return res;
- }
-
- return ((unsigned int)ret_val & 0xFF);
+ if (res != 0)
+ goto out;
}
- return 0;
+out:
+ if (res)
+ _module_unload(module);
+ return res;
}
void exec_term(void)