svn commit: r272699 - stable/9/sys/kern

Andriy Gapon avg at FreeBSD.org
Tue Oct 7 13:47:55 UTC 2014


Author: avg
Date: Tue Oct  7 13:47:54 2014
New Revision: 272699
URL: https://svnweb.freebsd.org/changeset/base/272699

Log:
  MFC r235978: device_add_child: protect against child device with no
  driver but fixed unit number

Modified:
  stable/9/sys/kern/subr_bus.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/subr_bus.c
==============================================================================
--- stable/9/sys/kern/subr_bus.c	Tue Oct  7 13:42:34 2014	(r272698)
+++ stable/9/sys/kern/subr_bus.c	Tue Oct  7 13:47:54 2014	(r272699)
@@ -1812,6 +1812,8 @@ device_add_child_ordered(device_t dev, u
 
 	PDEBUG(("%s at %s with order %u as unit %d",
 	    name, DEVICENAME(dev), order, unit));
+	KASSERT(name != NULL || unit == -1,
+	    ("child device with wildcard name and specific unit number"));
 
 	child = make_device(dev, name, unit);
 	if (child == NULL)


More information about the svn-src-stable-9 mailing list