From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, Sergey Shtylyov <s.shtylyov@omp.ru>,
Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 8/9] usb: host: xhci: drop redundant checks
Date: Wed, 16 Feb 2022 11:09:37 +0200 [thread overview]
Message-ID: <20220216090938.1260899-9-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <20220216090938.1260899-1-mathias.nyman@linux.intel.com>
From: Sergey Shtylyov <s.shtylyov@omp.ru>
In xhci_endpoint_{disable|reset}() 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>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
drivers/usb/host/xhci.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2a58677d9b7a..33bae434aa94 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3150,8 +3150,6 @@ static void xhci_endpoint_disable(struct usb_hcd *hcd,
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 usb_hcd *hcd,
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);
--
2.25.1
next prev parent reply other threads:[~2022-02-16 9:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 9:09 [PATCH 0/9] xhci and hub features for usb-next Mathias Nyman
2022-02-16 9:09 ` [PATCH 1/9] xhci: dbc: refactor xhci_dbc_init() Mathias Nyman
2022-02-16 9:09 ` [PATCH 2/9] xhci: dbc: create and remove dbc structure in dbgtty driver Mathias Nyman
2022-02-16 9:09 ` [PATCH 3/9] xhci: dbc: Rename xhci_dbc_init and xhci_dbc_exit Mathias Nyman
2022-02-16 9:09 ` [PATCH 4/9] xhci: dbc: Don't call dbc_tty_init() on every dbc tty probe Mathias Nyman
2022-02-16 9:09 ` [PATCH 5/9] xhci: dbgtty: use IDR to support several dbc instances Mathias Nyman
2022-02-16 9:09 ` [PATCH 6/9] xhci: Allocate separate command structures for each LPM command Mathias Nyman
2022-02-16 9:09 ` [PATCH 7/9] usb: remove Link Powermanagement (LPM) disable before port reset Mathias Nyman
2022-02-16 9:09 ` Mathias Nyman [this message]
2022-02-16 9:09 ` [PATCH 9/9] usb: xhci: fix minmax.cocci warnings Mathias Nyman
2022-02-16 9:21 ` [PATCH 0/9] xhci and hub features for usb-next Mathias Nyman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220216090938.1260899-9-mathias.nyman@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=s.shtylyov@omp.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox