Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160709984
D57607.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57607.diff
View Options
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -2295,22 +2295,23 @@
filename = linker_basename(pathname);
lfdep = linker_find_file_by_name(filename);
if (lfdep) {
- mod = modlist_lookup(modname, 0);
- MPASS(mod != NULL);
-
- if (modname && verinfo &&
- modlist_lookup2(modname, verinfo) == NULL) {
- /*
- * Desired module is already loaded, but the correct
- * version does not exist.
- */
- error = EXTERROR(ENOEXEC,
- "incompatible module version %jd already loaded",
- mod->version);
+ if (modname == NULL) {
+ error = EXTERROR(EEXIST, "file already loaded");
} else {
- error = EXTERROR(EEXIST,
- "module version %jd already loaded",
- mod->version);
+ mod = modlist_lookup(modname, 0);
+ if (mod == NULL) {
+ error = EXTERROR(ENOENT,
+ "module not found in already loaded file");
+ } else if (verinfo &&
+ modlist_lookup2(modname, verinfo) == NULL) {
+ error = EXTERROR(ENOEXEC,
+ "incompatible module version %jd already loaded",
+ mod->version);
+ } else {
+ error = EXTERROR(EEXIST,
+ "module version %jd already loaded",
+ mod->version);
+ }
}
} else do {
error = linker_load_file(pathname, &lfdep);
@@ -2319,9 +2320,14 @@
if (modname && verinfo &&
modlist_lookup2(modname, verinfo) == NULL) {
mod = modlist_lookup(modname, 0);
- error = EXTERROR(ENOEXEC,
+ if (mod == NULL) {
+ error = EXTERROR(ENOENT,
+ "module not found in loaded file");
+ } else {
+ error = EXTERROR(ENOEXEC,
"incompatible module version %jd already loaded",
- mod->version);
+ mod->version);
+ }
linker_file_unload(lfdep, LINKER_UNLOAD_FORCE);
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jun 28, 1:22 AM (11 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34027239
Default Alt Text
D57607.diff (1 KB)
Attached To
Mode
D57607: kldload: Fix some regressions in linker_load_module()
Attached
Detach File
Event Timeline
Log In to Comment