summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Berger <[email protected]>2026-03-21 16:26:23 +0100
committerCédric Berger <[email protected]>2026-03-21 16:26:23 +0100
commitc9fdfc7e1333eae7dc6a6eaa61e2f2d25966b13f (patch)
tree09ce0d9d1d784d94bc8235b2847ddd5dc72f6cef
parent8a9f44bdd267d05640d1028c07269d044291243b (diff)
Don't crash on driver without init()
Handle init() like deinit()
-rw-r--r--src/host/usbh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 75df6bf60..9dbd422b9 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -544,7 +544,7 @@ bool tuh_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
// Class drivers
for (uint8_t drv_id = 0; drv_id < TOTAL_DRIVER_COUNT; drv_id++) {
usbh_class_driver_t const* driver = get_driver(drv_id);
- if (driver != NULL) {
+ if (driver != NULL && driver->init) {
TU_LOG_USBH("%s init\r\n", driver->name);
driver->init();
}