diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 64fc501febea..d0299cb537a5 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -3291,16 +3291,18 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, first_trb = false; if (start_cycle == 0) field |= TRB_CYCLE; - /* - * Don't enable the ENT flag in the TRB if the - * transfer length of the first TRB isn't an - * integer multiple of the EP maxpacket. - */ - if (trb_buff_len % usb_endpoint_maxp(&urb->ep->desc)) - en_trb_ent = false; } else field |= ring->cycle_state; + /* + * Don't enable the ENT flag in the TRB if the + * transfer length of the TRB isn't an integer + * multiple of the EP maxpacket. + */ + if (en_trb_ent && + (trb_buff_len % usb_endpoint_maxp(&urb->ep->desc))) + en_trb_ent = false; + /* Chain all the TRBs together; clear the chain bit in the last * TRB to indicate it's the last TRB in the chain. */