summaryrefslogtreecommitdiffstats
path: root/sys/dev/md/md.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2010-02-27 10:41:30 +0000
committertrasz <trasz@FreeBSD.org>2010-02-27 10:41:30 +0000
commite9d23bc38ab9ba581b1c03e17a747e0553d725b9 (patch)
tree135e586dec44808eca91067237426e4aa9084eb2 /sys/dev/md/md.c
parent1d0c38de11a9e419918921345b87c673b09e2115 (diff)
downloadFreeBSD-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.c2
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;
OpenPOWER on IntegriCloud