* [PATCH] USB: core: remove dead code in do_proc_bulk()
@ 2024-11-08 9:42 Rex Nie
2024-11-08 9:45 ` kernel test robot
2024-11-08 14:08 ` Alan Stern
0 siblings, 2 replies; 4+ messages in thread
From: Rex Nie @ 2024-11-08 9:42 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.
Signed-off-by: Rex Nie <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] 4+ messages in thread
* Re: [PATCH] USB: core: remove dead code in do_proc_bulk()
2024-11-08 9:42 [PATCH] USB: core: remove dead code in do_proc_bulk() Rex Nie
@ 2024-11-08 9:45 ` kernel test robot
2024-11-08 14:08 ` Alan Stern
1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-11-08 9:45 UTC (permalink / raw)
To: Rex Nie; +Cc: stable, oe-kbuild-all
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] USB: core: remove dead code in do_proc_bulk()
Link: https://lore.kernel.org/stable/20241108094255.2133-1-rex.nie%40jaguarmicro.com
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] USB: core: remove dead code in do_proc_bulk()
2024-11-08 9:42 [PATCH] USB: core: remove dead code in do_proc_bulk() Rex Nie
2024-11-08 9:45 ` kernel test robot
@ 2024-11-08 14:08 ` Alan Stern
2024-11-09 1:32 ` 答复: " Rex Nie
1 sibling, 1 reply; 4+ messages in thread
From: Alan Stern @ 2024-11-08 14:08 UTC (permalink / raw)
To: Rex Nie; +Cc: gregkh, linux-usb, linux-kernel, angus.chen, stable
On Fri, Nov 08, 2024 at 05:42:55PM +0800, Rex Nie wrote:
> Since len1 is unsigned int, len1 < 0 always false. Remove it keep code
> simple.
>
> Signed-off-by: Rex Nie <rex.nie@jaguarmicro.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> ---
> 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 [flat|nested] 4+ messages in thread
* 答复: [PATCH] USB: core: remove dead code in do_proc_bulk()
2024-11-08 14:08 ` Alan Stern
@ 2024-11-09 1:32 ` Rex Nie
0 siblings, 0 replies; 4+ messages in thread
From: Rex Nie @ 2024-11-09 1:32 UTC (permalink / raw)
To: Alan Stern
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Angus Chen, stable@vger.kernel.org
HI Alan,
Thanks for your code review.
Rex
> -----邮件原件-----
> 发件人: Alan Stern <stern@rowland.harvard.edu>
> 发送时间: 2024年11月8日 22:09
> 收件人: Rex Nie <rex.nie@jaguarmicro.com>
> 抄送: gregkh@linuxfoundation.org; linux-usb@vger.kernel.org;
> linux-kernel@vger.kernel.org; Angus Chen <angus.chen@jaguarmicro.com>;
> stable@vger.kernel.org
> 主题: Re: [PATCH] USB: core: remove dead code in do_proc_bulk()
>
> External Mail: This email originated from OUTSIDE of the organization!
> Do not click links, open attachments or provide ANY information unless you
> recognize the sender and know the content is safe.
>
>
> On Fri, Nov 08, 2024 at 05:42:55PM +0800, Rex Nie wrote:
> > Since len1 is unsigned int, len1 < 0 always false. Remove it keep code
> > simple.
> >
> > Signed-off-by: Rex Nie <rex.nie@jaguarmicro.com>
>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
>
> > ---
> > 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 [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-09 1:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 9:42 [PATCH] USB: core: remove dead code in do_proc_bulk() Rex Nie
2024-11-08 9:45 ` kernel test robot
2024-11-08 14:08 ` Alan Stern
2024-11-09 1:32 ` 答复: " Rex Nie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox