Skip to content

Commit 1809548

Browse files
committed
host/dwc2: cleanup transfer on device close
Signed-off-by: HiFiPhile <[email protected]>
1 parent 5333d04 commit 1809548

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/portable/synopsys/dwc2/hcd_dwc2.c

+6
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,12 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr) {
448448
hcd_endpoint_t* edpt = &_hcd_data.edpt[i];
449449
if (edpt->hcchar_bm.enable && edpt->hcchar_bm.dev_addr == dev_addr) {
450450
tu_memclr(edpt, sizeof(hcd_endpoint_t));
451+
for (uint8_t j = 0; j < (uint8_t) DWC2_CHANNEL_COUNT_MAX; j++) {
452+
hcd_xfer_t* xfer = &_hcd_data.xfer[j];
453+
if (xfer->allocated && xfer->ep_id == i) {
454+
tu_memclr(xfer, sizeof(hcd_xfer_t));
455+
}
456+
}
451457
}
452458
}
453459
}

0 commit comments

Comments
 (0)