]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: mtu3: unmap request DMA on queue failure
authorHaoxiang Li <haoxiang_li2024@163.com>
Tue, 23 Jun 2026 09:33:25 +0000 (17:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jun 2026 15:04:26 +0000 (16:04 +0100)
commit0bddda5a11665c210339de76d27ebbd1a2e0b43c
tree18c5b1560200419080ab3f6914df01e322a401c5
parent692c354bef03b77b30e57e61934da502c8a12d45
usb: mtu3: unmap request DMA on queue failure

mtu3_gadget_queue() maps the request before checking whether
the QMU GPD ring can accept another transfer. the request is
returned with -EAGAIN before it is linked on the endpoint
request list if mtu3_prepare_transfer() fails.

Normal completion and dequeue paths unmap requests from
mtu3_req_complete(), but this error path never reaches that
helper, so the DMA mapping is left active. Unmap the request
before returning from the failed queue path.

Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Link: https://patch.msgid.link/20260623093325.2105323-1-haoxiang_li2024@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/mtu3/mtu3_gadget.c