diff options
| author | RigoLigo <[email protected]> | 2025-10-08 07:22:34 +0800 |
|---|---|---|
| committer | RigoLigo <[email protected]> | 2025-10-08 07:22:34 +0800 |
| commit | bf69c49c29a58055a166e7a3f172f36ee3abb8fb (patch) | |
| tree | b1772f41631856339cf418acc4d13d44d55de2e0 | |
| parent | 7a96291bf1fc88b7bacd387f1b236fa89470045f (diff) | |
fix incorrect MTP xact_len calculation
| -rw-r--r-- | src/class/mtp/mtp_device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/class/mtp/mtp_device.c b/src/class/mtp/mtp_device.c index 798a965eb..04bde9415 100644 --- a/src/class/mtp/mtp_device.c +++ b/src/class/mtp/mtp_device.c @@ -215,7 +215,7 @@ static bool mtpd_data_xfer(mtp_container_info_t* p_container, uint8_t ep_addr) { TU_ASSERT(p_mtp->phase == MTP_PHASE_DATA); } - const uint16_t xact_len = tu_min16((uint16_t) (p_mtp->total_len - p_mtp->xferred_len), CFG_TUD_MTP_EP_BUFSIZE); + const uint16_t xact_len = (uint16_t) tu_min32(p_mtp->total_len - p_mtp->xferred_len, CFG_TUD_MTP_EP_BUFSIZE); if (xact_len) { // already transferred all bytes in header's length. Application make an unnecessary extra call TU_VERIFY(usbd_edpt_claim(p_mtp->rhport, ep_addr)); |
