From 5ed1eb2bb072ba34cfd7d0928f2aa1951b7361f4 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sat, 27 Feb 2010 10:41:30 +0000 Subject: [PATCH] Fix panic on invalid 'mdconfig -at preload' usage. PR: kern/80136 --- sys/dev/md/md.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 20060999a23..78f2af3673c 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;