speaker load/unload bug fix

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Mon, 23 Aug 2004 21:15:13 -0600 (MDT)
Someone posted a bug where you did:

kldload speaker
kldunload speaker
devinfo -v
<crash>

Here's a patch...

Warner

Index: subr_bus.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/subr_bus.c,v
retrieving revision 1.156
diff -u -r1.156 subr_bus.c
--- subr_bus.c	18 Jul 2004 16:30:31 -0000	1.156
+++ subr_bus.c	24 Aug 2004 03:07:18 -0000
_at__at_ -1471,7 +1471,6 _at__at_
 		devclass_delete_device(child->devclass, child);
 	TAILQ_REMOVE(&dev->children, child, link);
 	TAILQ_REMOVE(&bus_data_devices, child, devlink);
-	device_set_desc(child, NULL);
 	kobj_delete((kobj_t) child, M_BUS);
 
 	bus_data_generation_update();
_at__at_ -2232,6 +2231,7 _at__at_
 
 	dev->state = DS_NOTPRESENT;
 	device_set_driver(dev, NULL);
+	device_set_desc(child, NULL);
 	device_sysctl_fini(dev);
 
 	return (0);
Received on Tue Aug 24 2004 - 01:15:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:08 UTC