Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154364843
D53938.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
D53938.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
@@ -703,9 +703,11 @@
/* Give eventhandlers a chance to prevent the unload. */
error = 0;
- EVENTHANDLER_INVOKE(kld_unload_try, file, &error);
- if (error != 0)
- return (EBUSY);
+ if ((file->flags & LINKER_FILE_LINKED) != 0) {
+ EVENTHANDLER_INVOKE(kld_unload_try, file, &error);
+ if (error != 0)
+ return (EBUSY);
+ }
KLD_DPF(FILE, ("linker_file_unload: file is unloading,"
" informing modules\n"));
@@ -768,10 +770,12 @@
* Don't try to run SYSUNINITs if we are unloaded due to a
* link error.
*/
- if (file->flags & LINKER_FILE_LINKED) {
+ if ((file->flags & LINKER_FILE_LINKED) != 0) {
file->flags &= ~LINKER_FILE_LINKED;
linker_file_unregister_sysctls(file);
linker_file_sysuninit(file);
+ EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address,
+ file->size);
}
TAILQ_REMOVE(&linker_files, file, link);
@@ -788,9 +792,6 @@
LINKER_UNLOAD(file);
- EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address,
- file->size);
-
if (file->filename) {
free(file->filename, M_LINKER);
file->filename = NULL;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 29, 3:20 AM (11 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32256816
Default Alt Text
D53938.diff (1 KB)
Attached To
Mode
D53938: linker: Avoid invoking eventhandlers on incompletely loaded files
Attached
Detach File
Event Timeline
Log In to Comment