summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-08-24 05:19:15 +0000
committerimp <imp@FreeBSD.org>2004-08-24 05:19:15 +0000
commit9b0c1e7ac1a709a6f41387b5675d2ac50df30239 (patch)
tree6be513def51a9cf37ebda948932c8c21d66d462b /sys
parenta52ebd899d42c188dbfb008967e2575b5daf05b7 (diff)
downloadFreeBSD-src-9b0c1e7ac1a709a6f41387b5675d2ac50df30239.zip
FreeBSD-src-9b0c1e7ac1a709a6f41387b5675d2ac50df30239.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_bus.c2
1 files changed, 1 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud