summaryrefslogtreecommitdiffstatsabout
path: root/SylixOS
diff options
context:
space:
mode:
authorHanhui <hanhui@acoinfo.com>2020-07-09 09:05:48 (GMT)
committer Hanhui <hanhui@acoinfo.com>2020-07-09 09:05:48 (GMT)
commita1485a81a25651e8e8ba16627bc36222ad72d8cb (patch)
tree8bbb19a68e821bb390b2dd86f07a56ddc566407e /SylixOS
parent89d7f26251a16d8b85c476b86ab1a97945fdb601 (diff)
downloadlibsylixos-a1485a81a25651e8e8ba16627bc36222ad72d8cb.zip
libsylixos-a1485a81a25651e8e8ba16627bc36222ad72d8cb.tar.gz
libsylixos-a1485a81a25651e8e8ba16627bc36222ad72d8cb.tar.bz2
Fix the error when the kernel module is loaded repeatedly.
Diffstat (limited to 'SylixOS')
-rw-r--r--SylixOS/loader/src/loader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/SylixOS/loader/src/loader.c b/SylixOS/loader/src/loader.c
index f159b11..211f4c0 100644
--- a/SylixOS/loader/src/loader.c
+++ b/SylixOS/loader/src/loader.c
@@ -900,6 +900,11 @@ PVOID API_ModuleLoadEx (CPCHAR pcFile,
pmodule = moduleLoadSub(pmodVProc, pcFile, LW_FALSE); /* 查找进程已装载模块链表 */
}
+ if (pmodule && (LW_NULL == pvVProc)) { /* 内核模块不允许重复加载 */
+ _ErrorHandle(EEXIST);
+ return (LW_NULL);
+ }
+
if (LW_NULL == pmodule) { /* 获取动态链接库位置 */
if (ERROR_NONE != moduleGetLibPath(pcFile, cLibPath, MAX_FILENAME_LENGTH, "LD_LIBRARY_PATH", &statFile)) {
if (ERROR_NONE != moduleGetLibPath(pcFile, cLibPath, MAX_FILENAME_LENGTH, "PATH", &statFile)) {