All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: linux-usb@vger.kernel.org
Cc: henryl@nvidia.com, gregkh@linuxfoundation.org,
	mathias.nyman@linux.intel.com, lorenzo.bianconi@redhat.com,
	nbd@nbd.name, sgruszka@redhat.com
Subject: [PATCH] usb: xhci: fix length check in xhci_align_td
Date: Thu,  4 Jul 2019 20:33:17 +0200	[thread overview]
Message-ID: <7c2f350f5a819f268d5f9f541784ccb073a35786.1562264858.git.lorenzo@kernel.org> (raw)

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@kernel.org>
---
 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


             reply	other threads:[~2019-07-04 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 18:33 Lorenzo Bianconi [this message]
2019-07-06 20:24 ` [PATCH] usb: xhci: fix length check in xhci_align_td Henry Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c2f350f5a819f268d5f9f541784ccb073a35786.1562264858.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=henryl@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=nbd@nbd.name \
    --cc=sgruszka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.