diff options
| author | HiFiPHile <[email protected]> | 2026-09-01 17:44:58 +0200 |
|---|---|---|
| committer | HiFiPHile <[email protected]> | 2026-09-02 15:21:41 +0200 |
| commit | 51761d2dfdf2036395b0b6ada6fdde213f97416f (patch) | |
| tree | 562a79f2c1c8aa2c90851129500706ccfc4c7c51 /src/tusb.c | |
| parent | a52b5a0c25d2cfea286d67eb3d9d8891a9b69e8f (diff) | |
| parent | 762517e6c41bedba73df04bc3c2181d7e5fe1d5e (diff) | |
Merge remote-tracking branch 'origin/master' into agent/fix-dwc2-host-fifo-allocation
Diffstat (limited to 'src/tusb.c')
| -rw-r--r-- | src/tusb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tusb.c b/src/tusb.c index 78ee7aeda..e1548e8c1 100644 --- a/src/tusb.c +++ b/src/tusb.c @@ -274,7 +274,7 @@ bool tu_edpt_validate(const tusb_desc_endpoint_t *desc_ep, tusb_speed_t speed) { #endif bool tu_bind_driver_to_ep_itf(uint8_t driver_id, uint8_t ep2drv[][2], uint8_t itf2drv[], uint8_t itf_max, - const uint8_t *p_desc, uint16_t desc_len) { + uint8_t ep_max, const uint8_t *p_desc, uint16_t desc_len) { const uint8_t *desc_end = p_desc + desc_len; while (tu_desc_in_bounds(p_desc, desc_end)) { const uint8_t desc_type = tu_desc_type(p_desc); @@ -283,6 +283,7 @@ bool tu_bind_driver_to_ep_itf(uint8_t driver_id, uint8_t ep2drv[][2], uint8_t it const uint8_t ep_addr = ((const tusb_desc_endpoint_t *)p_desc)->bEndpointAddress; const uint8_t ep_num = tu_edpt_number(ep_addr); const uint8_t ep_dir = tu_edpt_dir(ep_addr); + TU_ASSERT(ep_num < ep_max); ep2drv[ep_num][ep_dir] = driver_id; } else if (desc_type == TUSB_DESC_INTERFACE) { const tusb_desc_interface_t *desc_itf = (const tusb_desc_interface_t *)p_desc; |
