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 <hen...@nvidia.com>
---
 drivers/usb/host/xhci-ring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 {
-- 
2.7.4

Reply via email to