summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2002-04-10 01:14:45 +0000
committerbrian <brian@FreeBSD.org>2002-04-10 01:14:45 +0000
commitcd534ec28e063d5cfb62791130f77ae98176f6ab (patch)
treedc59b12298770ca1afc884b40684e8c0641ea19b /sys/kern
parent8ad55476a0c93a0bcb9e3363b8a11bd9a5c02883 (diff)
downloadFreeBSD-src-cd534ec28e063d5cfb62791130f77ae98176f6ab.zip
FreeBSD-src-cd534ec28e063d5cfb62791130f77ae98176f6ab.tar.gz
In linker_load_module(), check that rootdev != NODEV before calling
linker_search_module(). Without this, modules loaded from loader.conf that then try to load in additional modules (such as digi.ko loading a card's BIOS) die badly in the vn_open() called from linker_search_module(). It may be worth checking (KASSERTing?) that rootdev != NODEV in vn_open() too.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_linker.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index a88d636..91e8539 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1619,14 +1619,16 @@ linker_load_module(const char *kldname, const char *modname,
} else {
if (modlist_lookup2(modname, verinfo) != NULL)
return (EEXIST);
- if (kldname == NULL)
+ if (kldname != NULL)
+ pathname = linker_strdup(kldname);
+ else if (rootdev == NODEV)
+ pathname = NULL;
+ else
/*
* Need to find a KLD with required module
*/
pathname = linker_search_module(modname,
strlen(modname), verinfo);
- else
- pathname = linker_strdup(kldname);
}
if (pathname == NULL)
return (ENOENT);
OpenPOWER on IntegriCloud