mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: remove useless condition _ep_queue()
@ 2022-07-11 15:25 Andrey Strachuk
  2022-07-14 14:09 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Strachuk @ 2022-07-11 15:25 UTC (permalink / raw)
  To: Peter Chen
  Cc: Andrey Strachuk, Greg Kroah-Hartman, Alexander Shishkin,
	linux-usb, linux-kernel, ldv-project

Comparison of 'ep' with NULL is useless since
'ep' is a result of container_of and cannot be NULL
in any reasonable scenario.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
Fixes: 2dbc5c4c8314 ("usb: chipidea: get rid of camelcase names")
---
 drivers/usb/chipidea/udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 3b8bf6daf7d0..8ce31f9933e1 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -933,7 +933,7 @@ static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
 	struct ci_hdrc *ci = hwep->ci;
 	int retval = 0;
 
-	if (ep == NULL || req == NULL || hwep->ep.desc == NULL)
+	if (req == NULL || hwep->ep.desc == NULL)
 		return -EINVAL;
 
 	if (hwep->type == USB_ENDPOINT_XFER_CONTROL) {
-- 
2.25.1


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

* Re: [PATCH] usb: remove useless condition _ep_queue()
  2022-07-11 15:25 [PATCH] usb: remove useless condition _ep_queue() Andrey Strachuk
@ 2022-07-14 14:09 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2022-07-14 14:09 UTC (permalink / raw)
  To: Andrey Strachuk
  Cc: Peter Chen, Alexander Shishkin, linux-usb, linux-kernel, ldv-project

On Mon, Jul 11, 2022 at 06:25:03PM +0300, Andrey Strachuk wrote:
> Comparison of 'ep' with NULL is useless since
> 'ep' is a result of container_of and cannot be NULL
> in any reasonable scenario.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
> Fixes: 2dbc5c4c8314 ("usb: chipidea: get rid of camelcase names")
> ---
>  drivers/usb/chipidea/udc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Subject line is wrong :(

Also this is not a "Fix".


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

end of thread, other threads:[~2022-07-14 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 15:25 [PATCH] usb: remove useless condition _ep_queue() Andrey Strachuk
2022-07-14 14:09 ` Greg Kroah-Hartman

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

Powered by JetHome