diff mbox series

xhci: fix wrong WARN messages for bounce buffer

Message ID 1561529125-7118-1-git-send-email-henryl@nvidia.com (mailing list archive)
State Mainlined
Commit c03101ff4f74bb30679c1a03d551ecbef1024bf6
Headers show
Series xhci: fix wrong WARN messages for bounce buffer | expand

Commit Message

Henry Lin June 26, 2019, 6:05 a.m. UTC
This change fixes below wrong warning messages:

[  173.473153] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 1024 != 990
[  173.530633] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 490 != 1014
[  173.541598] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 490 != 1024
[  173.619507] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 1024 != 490
[  173.631982] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 1024 != 490
[  173.654629] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 108 != 1024
[  173.750209] xhci-hcd xhci-hcd.0.auto: WARN Wrong bounce buffer write length: 1024 != 108

Signed-off-by: Henry Lin <henryl@nvidia.com>
---
 drivers/usb/host/xhci-ring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 121782e..aa7231f 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3177,10 +3177,10 @@  static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len,
 	if (usb_urb_dir_out(urb)) {
 		len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs,
 				   seg->bounce_buf, new_buff_len, enqd_len);
-		if (len != seg->bounce_len)
+		if (len != new_buff_len)
 			xhci_warn(xhci,
 				"WARN Wrong bounce buffer write length: %zu != %d\n",
-				len, seg->bounce_len);
+				len, new_buff_len);
 		seg->bounce_dma = dma_map_single(dev, seg->bounce_buf,
 						 max_pkt, DMA_TO_DEVICE);
 	} else {