diff options
author | Mayank Rana <mrana@codeaurora.org> | 2017-10-06 17:45:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-17 10:38:13 +0200 |
commit | b3207c65dfafae27e7c492cb9188c0dc0eeaf3fd (patch) | |
tree | e2e01323c0bd94fdb7df61652cd455611e7c971a /drivers/usb/host/ehci-grlib.c | |
parent | 810a624bd1b64b13ddcc2eb5c1880526a750a870 (diff) |
usb: xhci: Handle error condition in xhci_stop_device()
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: c311e391a7ef ("xhci: rework command timeout and cancellation,")
Cc: <stable@vger.kernel.org>
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>
Diffstat (limited to 'drivers/usb/host/ehci-grlib.c')
0 files changed, 0 insertions, 0 deletions