From b39f919dbfabd409668fd9c8e137292f22a3d9e9 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 3 Dec 2011 22:56:27 +0100 Subject: [PATCH] Remove the root device from the root devices list. The device is added to the root devices list when initializing, but was not removed from there again when the root device was removed and freed, causing the list to have a stale entry. Probably fixes #3305. The list is populated once for the _fbsd_init_hardware iteration and, if a device was found, again for _fbsd_init_drivers. The only thing I don't understand is why it didn't just always crash, as there should have been a stale list entry in any case when a supported device actually was found... --- src/libs/compat/freebsd_network/compat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/compat/freebsd_network/compat.c b/src/libs/compat/freebsd_network/compat.c index 52594a7cd6..de2c046612 100644 --- a/src/libs/compat/freebsd_network/compat.c +++ b/src/libs/compat/freebsd_network/compat.c @@ -362,6 +362,8 @@ device_delete_child(device_t parent, device_t child) if (parent != NULL) list_remove_item(&parent->children, child); + else + list_remove_item(&sRootDevices, child); // We differentiate from the FreeBSD logic here - it will first delete // the children, and will then detach the device.