From: Rex Nie Date: Tue, 12 Nov 2024 15:20:22 +0000 (+0800) Subject: USB: core: remove dead code in do_proc_bulk() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fa518772fb63e201207bcdab7ea108198dc15f3c;p=users%2Fwilly%2Flinux.git USB: core: remove dead code in do_proc_bulk() Since len1 is unsigned int, len1 < 0 always false. Remove it keep code simple. Signed-off-by: Rex Nie Rule: add Link: https://lore.kernel.org/stable/20241108094255.2133-1-rex.nie%40jaguarmicro.com Acked-by: Alan Stern Link: https://lore.kernel.org/r/20241112152021.2236-1-rex.nie@jaguarmicro.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 5363468a282f..f6ce6e26e0d4 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1298,7 +1298,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)