linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henry Lin <henryl@nvidia.com>
To: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: xhci: fix length check in xhci_align_td
Date: Sat, 6 Jul 2019 20:24:50 +0000	[thread overview]
Message-ID: <MN2PR12MB33893D96E1517B67A527B330ACF40@MN2PR12MB3389.namprd12.prod.outlook.com> (raw)
In-Reply-To: <7c2f350f5a819f268d5f9f541784ccb073a35786.1562264858.git.lorenzo@kernel.org>

Similar change is posted in https://marc.info/?l=linux-usb&m=156152916509643&w=2
________________________________________
From: Lorenzo Bianconi <lorenzo@kernel.org>
Sent: Friday, July 5, 2019 2:33 AM
To: linux-usb@vger.kernel.org
Cc: Henry Lin; 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

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

-----------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------

      reply	other threads:[~2019-07-06 20:24 UTC|newest]

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

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=MN2PR12MB33893D96E1517B67A527B330ACF40@MN2PR12MB3389.namprd12.prod.outlook.com \
    --to=henryl@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).