Files
linux/drivers/usb/host
Mayank Rana 659b04ad20 usb: xhci: Handle error condition in xhci_stop_device()
commit b3207c65df upstream.

xhci_stop_device() calls xhci_queue_stop_endpoint() multiple times
without checking the return value. xhci_queue_stop_endpoint() can
return error if the HC is already halted or unable to queue commands.
This can cause a deadlock condition as xhci_stop_device() would
end up waiting indefinitely for a completion for the command that
didn't get queued. Fix this by checking the return value and bailing
out of xhci_stop_device() in case of error. This patch happens to fix
potential memory leaks of the allocated command structures as well.

Fixes: c311e391a7 ("xhci: rework command timeout and cancellation,")
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 09:49:13 +01:00
..
2014-11-03 15:26:15 -08:00
2013-12-03 10:34:33 -08:00
2015-04-03 19:03:18 +02:00
2013-12-03 10:34:33 -08:00
2015-04-03 19:03:18 +02:00
2017-05-25 15:44:36 +02:00
2015-04-03 19:03:17 +02:00
2017-05-25 15:44:36 +02:00
2015-01-25 21:01:13 +08:00
2017-05-25 15:44:36 +02:00
2015-06-08 14:26:22 -07:00