diff options
author | trasz <trasz@FreeBSD.org> | 2010-02-27 10:41:30 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2010-02-27 10:41:30 +0000 |
commit | e9d23bc38ab9ba581b1c03e17a747e0553d725b9 (patch) | |
tree | 135e586dec44808eca91067237426e4aa9084eb2 /sys/dev/md/md.c | |
parent | 1d0c38de11a9e419918921345b87c673b09e2115 (diff) | |
download | FreeBSD-src-e9d23bc38ab9ba581b1c03e17a747e0553d725b9.zip FreeBSD-src-e9d23bc38ab9ba581b1c03e17a747e0553d725b9.tar.gz |
Fix panic on invalid 'mdconfig -at preload' usage.
PR: kern/80136
Diffstat (limited to 'sys/dev/md/md.c')
-rw-r--r-- | sys/dev/md/md.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 2006099..78f2af3 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -814,6 +814,8 @@ mdcreate_preload(struct md_s *sc, struct md_ioctl *mdio) if (mdio->md_options & ~(MD_AUTOUNIT | MD_FORCE)) return (EINVAL); + if (mdio->md_base == 0) + return (EINVAL); sc->flags = mdio->md_options & MD_FORCE; /* Cast to pointer size, then to pointer to avoid warning */ sc->pl_ptr = (u_char *)(uintptr_t)mdio->md_base; |