]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Avoid infinite loop when sg urb requires too many trbs
authorBen Hutchings <ben@decadent.org.uk>
Mon, 6 Jan 2014 03:16:32 +0000 (03:16 +0000)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 8 Jan 2014 19:00:10 +0000 (11:00 -0800)
commit61f26783d2a9ad99c49cb03cde3778d03cf740c8
tree732bb8078c9afabbea795da9f53d3858c15dde58
parent3d539a506c862e0475f084cdc9a3a7adda31ede6
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: jidanni@jidanni.org
References: http://bugs.debian.org/733907
Fixes: 1a12bd45e307 ('usb: xhci: Link TRB must not occur within a USB payload burst')
Cc: stable <stable@vger.kernel.org> # 3.12
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-ring.c