fix(class/hub): delete thread before delete mq

Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
sakumisu
2025-11-04 21:50:43 +08:00
parent d0a8f5b2d0
commit 39bff0fb10

View File

@@ -731,7 +731,6 @@ int usbh_hub_deinitialize(struct usbh_bus *bus)
{
struct usbh_hubport *hport;
struct usbh_hub *hub;
size_t flags;
hub = &bus->hcd.roothub;
for (uint8_t port = 0; port < hub->nports; port++) {
@@ -740,14 +739,10 @@ int usbh_hub_deinitialize(struct usbh_bus *bus)
usbh_hubport_release(hport);
}
flags = usb_osal_enter_critical_section();
usb_hc_deinit(bus);
usb_osal_leave_critical_section(flags);
usb_osal_mq_delete(bus->hub_mq);
usb_osal_thread_delete(bus->hub_thread);
usb_osal_mq_delete(bus->hub_mq);
return 0;
}