summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMayank Rana <mrana@codeaurora.org>2017-10-06 17:45:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-02 09:36:48 +0100
commitaaa7d1a5d9f1293b13e378a0e0606b9f1487a355 (patch)
treede0ce340e696c99ddf06ab4e008361033cc67cad /include
parent55d4aa12af57ea7782f0c8bbc3b01e44673b05ba (diff)
usb: xhci: Handle error condition in xhci_stop_device()
commit b3207c65dfafae27e7c492cb9188c0dc0eeaf3fd 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: c311e391a7ef ("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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions