xhci: Fix false warning message about wrong bounce buffer write length
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 4 Oct 2019 11:59:26 +0000 (14:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2019 20:42:31 +0000 (13:42 -0700)
commit1817e62b7775d588fd32545392bd3b8002e5275d
tree92324c7659f67bd31a4cb9e4694d8f400ca8c034
parent46b9de8b5f84434f4eb06262cbd8d110d333c731
xhci: Fix false warning message about wrong bounce buffer write length

commit c03101ff4f74bb30679c1a03d551ecbef1024bf6 upstream.

The check printing out the "WARN Wrong bounce buffer write length:"
uses incorrect values when comparing bytes written from scatterlist
to bounce buffer. Actual copied lengths are fine.

The used seg->bounce_len will be set to equal new_buf_len a few lines later
in the code, but is incorrect when doing the comparison.

The patch which added this false warning was backported to 4.8+ kernels
so this should be backported as far as well.

Cc: <stable@vger.kernel.org> # v4.8+
Fixes: 597c56e372da ("xhci: update bounce buffer with correct sg num")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/1570190373-30684-2-git-send-email-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c