mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
xhci: Avoid infinite loop when sg urb requires too many trbs
Currently prepare_ring() returns -ENOMEM if the urb won't fit into a
single ring segment. usb_sg_wait() treats this error as a temporary
condition and will keep retrying until something else goes wrong.
The number of retries should be limited in usb_sg_wait(), but also
prepare_ring() should not return an error code that suggests it might
be worth retrying. Change it to -EINVAL.
Reported-by: [email protected]
References: http://bugs.debian.org/733907
Fixes: 35773dac5f ('usb: xhci: Link TRB must not occur within a USB payload burst')
Cc: stable <[email protected]> # 3.12
Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Sarah Sharp <[email protected]>
This commit is contained in:
parent
d85b277ed1
commit
d6c9ea9069
1 changed files with 1 additions and 1 deletions
|
|
@ -3000,7 +3000,7 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
|
|||
if (num_trbs >= TRBS_PER_SEGMENT) {
|
||||
xhci_err(xhci, "Too many fragments %d, max %d\n",
|
||||
num_trbs, TRBS_PER_SEGMENT - 1);
|
||||
return -ENOMEM;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) |
|
||||
|
|
|
|||
Loading…
Reference in a new issue