summaryrefslogtreecommitdiff
path: root/class
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2023-11-22 21:44:51 +0800
committersakumisu <[email protected]>2023-11-22 21:44:51 +0800
commit50e1cd3471c138b73d79bc3b7d5f0c3c5dad3fe6 (patch)
tree00b927630ccab2023a608b2707a783c76f54db0f /class
parentb7d02b71253701a89dd3738497b034e74b0ae077 (diff)
add mutex for ep0 urb to avoid multithreading
Diffstat (limited to 'class')
-rw-r--r--class/hub/usbh_hub.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c
index fe660fc4..b967a37d 100644
--- a/class/hub/usbh_hub.c
+++ b/class/hub/usbh_hub.c
@@ -310,6 +310,7 @@ static void usbh_hubport_release(struct usbh_hubport *child)
}
child->config.config_desc.bNumInterfaces = 0;
usbh_kill_urb(&child->ep0_urb);
+ usb_osal_mutex_delete(child->mutex);
}
}
@@ -598,6 +599,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
child->connected = true;
child->port = port + 1;
child->speed = speed;
+ child->mutex = usb_osal_mutex_create();
USB_LOG_INFO("New %s device on Hub %u, Port %u connected\r\n", speed_table[speed], hub->index, port + 1);