From owner-svn-src-all@FreeBSD.ORG Fri May 25 07:32:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CC6D106566B; Fri, 25 May 2012 07:32:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 574A18FC0A; Fri, 25 May 2012 07:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P7WRnS088002; Fri, 25 May 2012 07:32:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7WRE2088000; Fri, 25 May 2012 07:32:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205250732.q4P7WRE2088000@svn.freebsd.org> From: Andriy Gapon Date: Fri, 25 May 2012 07:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235978 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:32:27 -0000 Author: avg Date: Fri May 25 07:32:26 2012 New Revision: 235978 URL: http://svn.freebsd.org/changeset/base/235978 Log: device_add_child: protect against child device with no driver but fixed unit number This combination doesn't make sense, unit numbers should be hardwired only in context of a known driver. The wildcard devices should have wildcard unit numbers. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri May 25 07:25:30 2012 (r235977) +++ head/sys/kern/subr_bus.c Fri May 25 07:32:26 2012 (r235978) @@ -1810,6 +1810,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)