summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/quatech2.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2017-01-03 18:28:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-03 17:37:32 +0100
commit29fc1aa454d0603493b47a8e2410ae6e9ab20258 (patch)
treeb3043688b5e5ac95ea3e9b9398b9726f3be4565a /drivers/usb/serial/quatech2.c
parent6c97cfc1a097b1e0786c836e92b7a72b4d031e25 (diff)
downloadop-kernel-dev-29fc1aa454d0603493b47a8e2410ae6e9ab20258.zip
op-kernel-dev-29fc1aa454d0603493b47a8e2410ae6e9ab20258.tar.gz
usb: host: xhci: handle COMP_STOP from SETUP phase too
Stop Endpoint command can come at any point and we have no control of that. We should make sure to handle COMP_STOP on SETUP phase as well, otherwise urb->actual_length might be set to negative values in some occasions such as below: urb->length = 4; build_control_transfer_td_for(urb, ep); stop_endpoint(ep); COMP_STOP: [...] urb->actual_length = urb->length - trb->length; trb->length is 8 for SETUP stage (8 control request bytes), so actual_length would be set to -4 in this case. While doing that, also make sure to use TRB_TYPE field of the actual TRB instead of matching pointers to figure out in which stage of the control transfer we got our completion event. Cc: <stable@vger.kernel.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/quatech2.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud