@@ -2410,26 +2410,23 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep,
sum_trbs_for_length = true;
fallthrough;
case COMP_ISOCH_BUFFER_OVERRUN:
frame->status = -EOVERFLOW;
- if (ep_trb != td->last_trb)
- td->error_mid_td = true;
+ td->error_mid_td = true;
break;
case COMP_MISSED_SERVICE_ERROR:
frame->status = -EXDEV;
sum_trbs_for_length = true;
- if (ep_trb != td->last_trb)
- td->error_mid_td = true;
+ td->error_mid_td = true;
break;
case COMP_INCOMPATIBLE_DEVICE_ERROR:
case COMP_STALL_ERROR:
frame->status = -EPROTO;
break;
case COMP_USB_TRANSACTION_ERROR:
frame->status = -EPROTO;
sum_trbs_for_length = true;
- if (ep_trb != td->last_trb)
- td->error_mid_td = true;
+ td->error_mid_td = true;
break;
case COMP_STOPPED:
sum_trbs_for_length = true;
break;
It doesn't matter whether we set this flag or not on the final TRB, because the TD is about to be immediately "finished" anyway. Without these checks the code looks cleaner and easier to follow. Signed-off-by: Michal Pecio <michal.pecio@gmail.com> --- drivers/usb/host/xhci-ring.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)