mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Avoid starting the USB transfer if an error is already pending.
This change fixes a race in device side mode during clear-stall from host, which can cause data to be sent too early on the given endpoint. Approved by: re (kib) MFC after: 1 week
This commit is contained in:
parent
f3536faf94
commit
3e677ca02c
1 changed files with 6 additions and 4 deletions
|
|
@ -2417,8 +2417,9 @@ usbd_transfer_start_cb(void *arg)
|
|||
#if USB_HAVE_PF
|
||||
usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
|
||||
#endif
|
||||
/* start the transfer */
|
||||
(ep->methods->start) (xfer);
|
||||
/* start USB transfer, if no error */
|
||||
if (xfer->error == 0)
|
||||
(ep->methods->start) (xfer);
|
||||
|
||||
xfer->flags_int.can_cancel_immed = 1;
|
||||
|
||||
|
|
@ -2597,8 +2598,9 @@ usbd_pipe_start(struct usb_xfer_queue *pq)
|
|||
#if USB_HAVE_PF
|
||||
usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT);
|
||||
#endif
|
||||
/* start USB transfer */
|
||||
(ep->methods->start) (xfer);
|
||||
/* start USB transfer, if no error */
|
||||
if (xfer->error == 0)
|
||||
(ep->methods->start) (xfer);
|
||||
|
||||
xfer->flags_int.can_cancel_immed = 1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue