aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/module/shallow_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/sys/module/shallow_module.c')
-rw-r--r--com32/lib/sys/module/shallow_module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/com32/lib/sys/module/shallow_module.c b/com32/lib/sys/module/shallow_module.c
index 1b76aaae..ed196cd9 100644
--- a/com32/lib/sys/module/shallow_module.c
+++ b/com32/lib/sys/module/shallow_module.c
@@ -118,6 +118,12 @@ int module_load_shallow(struct elf_module *module) {
int res;
Elf32_Ehdr elf_hdr;
+ // Do not allow duplicate modules
+ if (module_find(module->name) != NULL) {
+ DBG_PRINT("Module already loaded.\n");
+ return -1;
+ }
+
res = image_load(module);
if (res < 0)