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.
This commit is contained in:
Warner Losh 2004-08-24 05:19:15 +00:00
parent cf03a9be9c
commit 0160658e84
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134239

View File

@ -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);