* [PATCH] usb: host: xhci: drop redundant checks
@ 2022-02-08 19:33 Sergey Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Shtylyov @ 2022-02-08 19:33 UTC (permalink / raw)
To: Mathias Nyman, linux-usb, Greg Kroah-Hartman
In xhci_endpoint_{disable|}() the expression '&vdev->eps[ep_index]' just
cannot be NULL, so the checks have no sense at all...
Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Resending with correct Greg KH's address, hopefully... :-)
drivers/usb/host/xhci.c | 4 ----
1 file changed, 4 deletions(-)
Index: usb/drivers/usb/host/xhci.c
===================================================================
--- usb.orig/drivers/usb/host/xhci.c
+++ usb/drivers/usb/host/xhci.c
@@ -3150,8 +3150,6 @@ rescan:
ep_index = xhci_get_endpoint_index(&host_ep->desc);
ep = &vdev->eps[ep_index];
- if (!ep)
- goto done;
/* wait for hub_tt_work to finish clearing hub TT */
if (ep->ep_state & EP_CLEARING_TT) {
@@ -3209,8 +3207,6 @@ static void xhci_endpoint_reset(struct u
return;
ep_index = xhci_get_endpoint_index(&host_ep->desc);
ep = &vdev->eps[ep_index];
- if (!ep)
- return;
/* Bail out if toggle is already being cleared by a endpoint reset */
spin_lock_irqsave(&xhci->lock, flags);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] usb: host: xhci: drop redundant checks
@ 2022-02-08 19:31 Sergey Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Shtylyov @ 2022-02-08 19:31 UTC (permalink / raw)
To: Mathias Nyman, Greg Kroah-Hartman <gregkh, linux-usb
In xhci_endpoint_{disable|}() the expression '&vdev->eps[ep_index]' just
cannot be NULL, so the checks have no sense at all...
Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/host/xhci.c | 4 ----
1 file changed, 4 deletions(-)
Index: usb/drivers/usb/host/xhci.c
===================================================================
--- usb.orig/drivers/usb/host/xhci.c
+++ usb/drivers/usb/host/xhci.c
@@ -3150,8 +3150,6 @@ rescan:
ep_index = xhci_get_endpoint_index(&host_ep->desc);
ep = &vdev->eps[ep_index];
- if (!ep)
- goto done;
/* wait for hub_tt_work to finish clearing hub TT */
if (ep->ep_state & EP_CLEARING_TT) {
@@ -3209,8 +3207,6 @@ static void xhci_endpoint_reset(struct u
return;
ep_index = xhci_get_endpoint_index(&host_ep->desc);
ep = &vdev->eps[ep_index];
- if (!ep)
- return;
/* Bail out if toggle is already being cleared by a endpoint reset */
spin_lock_irqsave(&xhci->lock, flags);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-08 19:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 19:33 [PATCH] usb: host: xhci: drop redundant checks Sergey Shtylyov
-- strict thread matches above, loose matches on Subject: below --
2022-02-08 19:31 Sergey Shtylyov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.