svn commit: r233355 - in stable/9/sys: i386/conf kern

John Baldwin jhb at FreeBSD.org
Fri Mar 23 12:01:34 UTC 2012


Author: jhb
Date: Fri Mar 23 12:01:33 2012
New Revision: 233355
URL: http://svn.freebsd.org/changeset/base/233355

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

Modified:
  stable/9/sys/kern/subr_bus.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/sys/kern/subr_bus.c
==============================================================================
--- stable/9/sys/kern/subr_bus.c	Fri Mar 23 11:35:01 2012	(r233354)
+++ stable/9/sys/kern/subr_bus.c	Fri Mar 23 12:01:33 2012	(r233355)
@@ -2726,9 +2726,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;


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