public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] USB: core: remove dead code in do_proc_bulk()
@ 2024-11-09  2:11 Rex Nie
  2024-11-09  6:59 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Rex Nie @ 2024-11-09  2:11 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, linux-kernel, angus.chen, stable, Rex Nie

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-12 11:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-09  2:11 [PATCH v2] USB: core: remove dead code in do_proc_bulk() Rex Nie
2024-11-09  6:59 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox