mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
Kernel: Fix USB hotplug crash
Currently the SysFS node for USB devices is only initialized for USB hubs, which means it will cause a kernel crash upon being dereferenced in a non-hub device. This fixes the problem by making initialization happen for all USB devices.
This commit is contained in:
parent
11cb7c7b28
commit
4b1537387f
2 changed files with 2 additions and 2 deletions
|
@ -45,8 +45,6 @@ ErrorOr<void> Hub::enumerate_and_power_on_hub()
|
|||
// USBDevice::enumerate_device must be called before this.
|
||||
VERIFY(m_address > 0);
|
||||
|
||||
m_sysfs_device_info_node = TRY(SysFSUSBDeviceInformation::create(*this));
|
||||
|
||||
if (m_device_descriptor.device_class != USB_CLASS_HUB) {
|
||||
dbgln("USB Hub: Trying to enumerate and power on a device that says it isn't a hub.");
|
||||
return EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue