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 @@ -1862,6 +1862,9 @@ sx_xlock(&kld_sx); TAILQ_FOREACH_SAFE(lf, &linker_files, link, nlf) { + if (lf == linker_kernel_file) + continue; + /* * If all of the modules in this file failed to load, unload * the file and return an error of ENOEXEC. (Parity with