Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2014 13:47:55 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r272699 - stable/9/sys/kern
Message-ID:  <201410071347.s97DltjJ097253@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410071347.s97DltjJ097253>