Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2012 12:02:00 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r233356 - in stable/8/sys: i386/conf kern
Message-ID:  <201203231202.q2NC20SV075239@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Mar 23 12:02:00 2012
New Revision: 233356
URL: http://svn.freebsd.org/changeset/base/233356

Log:
  MFC 232265:
  Properly clear a device's devclass if DEVICE_ATTACH() fails if the device
  does not have a fixed devclass.

Modified:
  stable/8/sys/kern/subr_bus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/kern/subr_bus.c
==============================================================================
--- stable/8/sys/kern/subr_bus.c	Fri Mar 23 12:01:33 2012	(r233355)
+++ stable/8/sys/kern/subr_bus.c	Fri Mar 23 12:02:00 2012	(r233356)
@@ -2729,9 +2729,8 @@ device_attach(device_t dev)
 	if ((error = DEVICE_ATTACH(dev)) != 0) {
 		printf("device_attach: %s%d attach returned %d\n",
 		    dev->driver->name, dev->unit, error);
-		/* Unset the class; set in device_probe_child */
-		if (dev->devclass == NULL)
-			(void)device_set_devclass(dev, NULL);
+		if (!(dev->flags & DF_FIXEDCLASS))
+			devclass_delete_device(dev->devclass, dev);
 		(void)device_set_driver(dev, NULL);
 		device_sysctl_fini(dev);
 		dev->state = DS_NOTPRESENT;



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