diff --git a/esphome/components/usb_host/usb_host_client.cpp b/esphome/components/usb_host/usb_host_client.cpp index 5c8874861e..91d7af2898 100644 --- a/esphome/components/usb_host/usb_host_client.cpp +++ b/esphome/components/usb_host/usb_host_client.cpp @@ -428,8 +428,8 @@ static void transfer_callback(usb_transfer_t *xfer) { trq->callback(trq->status); } - // Release transfer slot immediately in USB task to prevent slot exhaustion - // This is critical for high-throughput transfers (e.g., USB UART at 115200 baud) + // Release transfer slot AFTER callback completes to prevent slot exhaustion + // The callback has finished accessing xfer->data_buffer, so it's safe to release // The release_trq() uses thread-safe atomic operations trq->client->release_trq(trq); }