Re: [PATCH] usb: xhci: fix length check in xhci_align_td

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Similar change is posted in https://marc.info/?l=linux-usb&m=156152916509643&w=2
________________________________________
From: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
Sent: Friday, July 5, 2019 2:33 AM
To: linux-usb@xxxxxxxxxxxxxxx
Cc: Henry Lin; gregkh@xxxxxxxxxxxxxxxxxxx; mathias.nyman@xxxxxxxxxxxxxxx; lorenzo.bianconi@xxxxxxxxxx; nbd@xxxxxxxx; sgruszka@xxxxxxxxxx
Subject: [PATCH] usb: xhci: fix length check in xhci_align_td

Fix the following warning due to a wrong length check after
sg_pcopy_to_buffer in xhci_align_td

xhci_hcd 0000:00:04.0: WARN Wrong bounce buffer write length: 158 != 284
xhci_hcd 0000:00:04.0: WARN Wrong bounce buffer write length: 234 != 158
xhci_hcd 0000:00:04.0: WARN Wrong bounce buffer write length: 208 != 234
xhci_hcd 0000:00:04.0: WARN Wrong bounce buffer write length: 82 != 208

Fixes: 597c56e372da ("xhci: update bounce buffer with correct sg num")
Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
---
 drivers/usb/host/xhci-ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 121782e22c01..72fc6980c641 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3177,7 +3177,7 @@ 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);
--
2.21.0

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux