From patchwork Wed Feb 16 09:09:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12748245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15506C433FE for ; Wed, 16 Feb 2022 09:08:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231879AbiBPJIm (ORCPT ); Wed, 16 Feb 2022 04:08:42 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:52222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbiBPJIl (ORCPT ); Wed, 16 Feb 2022 04:08:41 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFBEC1C123 for ; Wed, 16 Feb 2022 01:08:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645002503; x=1676538503; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L9IoCPdVPu8QzPwB9ZH3k81wJN+NTTltzRqmgvJF9Y4=; b=A49lUQ+VbO44zYawsxqK9Ywu+/8TL1KDRygz+FFte1HhTKCJqCUFel9F nLJIDacpZ+LiQdVv1O3aHNjgeNn1bpXr0CiJ3LWIMcSS4jnd1WhdRyXPk dMNfKPSRc49sl0KF5CUNkEo3Hj2ehtebxs+1idqc640Ifu9hPKnaeRgqn gCS1ceXo9SNSzQCuahSCw1YkvvkGO/jYoPntWKmBYohfgR0ubi3e4V0YM lcUYcugCBh3hQJtXGt3sM2fu1tHmJzaAbQaaokihplzq8CJLfnbgQ5DDy KfM/ihFcaARDJsYURrhag8IhGwhq+dy7BEaVXGbk4L/rOjRSq2GCY7Dco A==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="250296051" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="250296051" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 01:08:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="571190388" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by orsmga001.jf.intel.com with ESMTP; 16 Feb 2022 01:08:18 -0800 From: Mathias Nyman To: Cc: , Sergey Shtylyov , Mathias Nyman Subject: [PATCH 8/9] usb: host: xhci: drop redundant checks Date: Wed, 16 Feb 2022 11:09:37 +0200 Message-Id: <20220216090938.1260899-9-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220216090938.1260899-1-mathias.nyman@linux.intel.com> References: <20220216090938.1260899-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Sergey Shtylyov 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 Signed-off-by: Mathias Nyman --- 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);