svn commit: r204408 - head/sys/dev/md

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Feb 27 10:41:31 UTC 2010


Author: trasz
Date: Sat Feb 27 10:41:30 2010
New Revision: 204408
URL: http://svn.freebsd.org/changeset/base/204408

Log:
  Fix panic on invalid 'mdconfig -at preload' usage.
  
  PR:		kern/80136

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c	Sat Feb 27 10:19:39 2010	(r204407)
+++ head/sys/dev/md/md.c	Sat Feb 27 10:41:30 2010	(r204408)
@@ -814,6 +814,8 @@ mdcreate_preload(struct md_s *sc, struct
 
 	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;


More information about the svn-src-all mailing list