Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170913414
D8070.id20856.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8070.id20856.diff
View Options
Index: sys/boot/kshim/bsd_kernel.c
===================================================================
--- sys/boot/kshim/bsd_kernel.c
+++ sys/boot/kshim/bsd_kernel.c
@@ -817,8 +817,12 @@
int error = 0;
device_t grandchild;
- /* remove children first */
+ /* detach parent before deleting children, if any */
+ error = device_detach(child);
+ if (error)
+ goto done;
+ /* remove children second */
while ((grandchild = TAILQ_FIRST(&child->dev_children))) {
error = device_delete_child(child, grandchild);
if (error) {
@@ -827,11 +831,6 @@
}
}
- error = device_detach(child);
-
- if (error)
- goto done;
-
devclass_delete_device(child->dev_module, child);
if (dev != NULL) {
Index: sys/kern/subr_bus.c
===================================================================
--- sys/kern/subr_bus.c
+++ sys/kern/subr_bus.c
@@ -1949,15 +1949,17 @@
PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev)));
- /* remove children first */
+ /* detach parent before deleting children, if any */
+ if ((error = device_detach(child)) != 0)
+ return (error);
+
+ /* remove children second */
while ((grandchild = TAILQ_FIRST(&child->children)) != NULL) {
error = device_delete_child(child, grandchild);
if (error)
return (error);
}
- if ((error = device_detach(child)) != 0)
- return (error);
if (child->devclass)
devclass_delete_device(child->devclass, child);
if (child->parent)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 8, 1:15 PM (12 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38518087
Default Alt Text
D8070.id20856.diff (1 KB)
Attached To
Mode
D8070: Fix device delete child function
Attached
Detach File
Event Timeline
Log In to Comment