diff mbox series

usb: musb: remove useless condition from musb_gadget_dequeue()

Message ID 20220711151736.17382-1-strochuk@ispras.ru
State New
Headers show
Series usb: musb: remove useless condition from musb_gadget_dequeue() | expand

Commit Message

Andrey Strachuk July 11, 2022, 3:17 p.m. UTC
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: 47e9760529a9 ("USB: musb_gadget: implement set_wedge() method")
---
 drivers/usb/musb/musb_gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman July 14, 2022, 2:09 p.m. UTC | #1
On Mon, Jul 11, 2022 at 06:17:36PM +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.

Again, show the call stack as this is not called with container_of()
here.

thanks,

greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 51274b87f46c..32447b7b1976 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1271,7 +1271,7 @@  static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request)
 	int			status = 0;
 	struct musb		*musb = musb_ep->musb;
 
-	if (!ep || !request || req->ep != musb_ep)
+	if (!request || req->ep != musb_ep)
 		return -EINVAL;
 
 	trace_musb_req_deq(req);