diff --git a/src/add-ons/kernel/drivers/audio/usb/Device.cpp b/src/add-ons/kernel/drivers/audio/usb/Device.cpp index 955b608333..fa15b7d36a 100644 --- a/src/add-ons/kernel/drivers/audio/usb/Device.cpp +++ b/src/add-ons/kernel/drivers/audio/usb/Device.cpp @@ -795,6 +795,8 @@ Device::_SetupEndpoints() for (size_t i = 0; i < config->interface_count; i++) { usb_interface_info* Interface = config->interface[i].active; + if (Interface == NULL || Interface->descr == NULL) + continue; if (Interface->descr->interface_class != USB_AUDIO_INTERFACE_AUDIO_CLASS) continue; diff --git a/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp b/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp index 889ba0b7c3..a1435c457c 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp @@ -105,6 +105,9 @@ usb_hid_device_added(usb_device device, void **cookie) int32 parentCookie = atomic_add(&sParentCookie, 1); for (size_t i = 0; i < config->interface_count; i++) { const usb_interface_info *interface = config->interface[i].active; + if (interface == NULL || interface->descr == NULL) + continue; + uint8 interfaceClass = interface->descr->interface_class; TRACE("interface %" B_PRIuSIZE ": class: %u; subclass: %u; protocol: " "%u\n", i, interfaceClass, interface->descr->interface_subclass, diff --git a/src/libs/compat/freebsd_network/usb.cpp b/src/libs/compat/freebsd_network/usb.cpp index f27449377a..1fea0e9713 100644 --- a/src/libs/compat/freebsd_network/usb.cpp +++ b/src/libs/compat/freebsd_network/usb.cpp @@ -89,7 +89,13 @@ get_next_usb_device(uint32* cookie, freebsd_usb_device* result) result->endpoints_max = 0; for (size_t i = 0; i < config->interface_count; i++) { usb_interface_info* iface = config->interface[i].active; + if (iface == NULL) + continue; + for (size_t j = 0; j < iface->endpoint_count; j++) { + if (iface->endpoint[j].descr == NULL) + continue; + const int rep = result->endpoints_max++; result->endpoints[rep].iface_index = i;