From 9b0c1e7ac1a709a6f41387b5675d2ac50df30239 Mon Sep 17 00:00:00 2001 From: imp Date: Tue, 24 Aug 2004 05:19:15 +0000 Subject: Set the description to NULL in the right detach routine. This should keep dangling pointers to strings in loaded modules from hanging around after the drivers are unloaded. --- sys/kern/subr_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 6999a77..d1a8ecd 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1471,7 +1471,6 @@ device_delete_child(device_t dev, device_t child) 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(); @@ -2232,6 +2231,7 @@ device_detach(device_t dev) dev->state = DS_NOTPRESENT; device_set_driver(dev, NULL); + device_set_desc(dev, NULL); device_sysctl_fini(dev); return (0); -- cgit v1.1