1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:08:12 +00:00

Kernel/USB: Detach devices from their driver when they are detached

This commit is contained in:
Hendiadyoin1 2023-09-15 19:13:44 +02:00 committed by Andrew Kaster
parent b4cd354bae
commit d168bfabc4
3 changed files with 15 additions and 0 deletions

View file

@ -295,6 +295,9 @@ void Hub::check_for_port_updates()
auto* hub_child = static_cast<Hub*>(device_to_remove.ptr());
hub_child->remove_children_from_sysfs();
}
device_to_remove->detach();
m_children.remove(*device_to_remove);
} else {
dbgln_if(USB_DEBUG, "USB Hub: No child set up on port {}, ignoring detachment.", port_number);