git: 4f40c7c37fb4 - stable/15 - usb: Add missing mtx lock and unlock in pushing dma queue
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 23 Jun 2026 20:53:07 UTC
The branch stable/15 has been updated by aokblast:
URL: https://cgit.FreeBSD.org/src/commit/?id=4f40c7c37fb458b6a5c494a28bd78aa1d66fa9a8
commit 4f40c7c37fb458b6a5c494a28bd78aa1d66fa9a8
Author: ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2026-05-28 08:42:11 +0000
Commit: ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2026-06-23 20:52:08 +0000
usb: Add missing mtx lock and unlock in pushing dma queue
Accessing usb_xfer_queue requires bus lock, we added this missing lock
in here to prevent racing issue.
Reviewed by: adrian
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57293
(cherry picked from commit df5e9e3da5b9b3fe63ed4aaaa19b824fd18ae0f2)
---
sys/dev/usb/usb_transfer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c
index 67745cf49397..d41121ed3a06 100644
--- a/sys/dev/usb/usb_transfer.c
+++ b/sys/dev/usb/usb_transfer.c
@@ -1889,8 +1889,10 @@ usbd_transfer_submit(struct usb_xfer *xfer)
*/
#if USB_HAVE_BUSDMA
if (xfer->flags_int.bdma_enable) {
+ USB_BUS_LOCK(bus);
/* insert the USB transfer last in the BUS-DMA queue */
usb_command_wrapper(&xfer->xroot->dma_q, xfer);
+ USB_BUS_UNLOCK(bus);
return;
}
#endif