From: Rex Nie <rex.nie@jaguarmicro.com>
To: gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
angus.chen@jaguarmicro.com, stable@vger.kernel.org,
Rex Nie <rex.nie@jaguarmicro.com>
Subject: [PATCH v2] USB: core: remove dead code in do_proc_bulk()
Date: Sat, 9 Nov 2024 10:11:41 +0800 [thread overview]
Message-ID: <20241109021140.2174-1-rex.nie@jaguarmicro.com> (raw)
Since len1 is unsigned int, len1 < 0 always false. Remove it keep code
simple.
Cc: stable@vger.kernel.org
Fixes: ae8709b296d8 ("USB: core: Make do_proc_control() and do_proc_bulk() killable")
Signed-off-by: Rex Nie <rex.nie@jaguarmicro.com>
---
changes in v2:
- Add "Cc: stable@vger.kernel.org" (kernel test robot)
- Add Fixes tag
- Link to v1: https://lore.kernel.org/stable/20241108094255.2133-1-rex.nie@jaguarmicro.com/
---
drivers/usb/core/devio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3beb6a862e80..712e290bab04 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1295,7 +1295,7 @@ static int do_proc_bulk(struct usb_dev_state *ps,
return ret;
len1 = bulk->len;
- if (len1 < 0 || len1 >= (INT_MAX - sizeof(struct urb)))
+ if (len1 >= (INT_MAX - sizeof(struct urb)))
return -EINVAL;
if (bulk->ep & USB_DIR_IN)
--
2.17.1
next reply other threads:[~2024-11-09 2:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-09 2:11 Rex Nie [this message]
2024-11-09 6:59 ` [PATCH v2] USB: core: remove dead code in do_proc_bulk() Greg KH
2024-11-09 11:38 ` 答复: " Rex Nie
2024-11-09 11:47 ` Greg KH
2024-11-11 8:01 ` 答复: " Rex Nie
2024-11-12 11:11 ` Greg KH
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=20241109021140.2174-1-rex.nie@jaguarmicro.com \
--to=rex.nie@jaguarmicro.com \
--cc=angus.chen@jaguarmicro.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@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