Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4132252pxb; Mon, 8 Feb 2021 08:40:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLxR7PU5RCfqIJdlj17BEcV9Hk2lpKjslk2i6txe17C60nBDM68GNwP87fJsiLhRYr3G2Y X-Received: by 2002:a17:907:2ace:: with SMTP id fm14mr11768340ejc.475.1612802413148; Mon, 08 Feb 2021 08:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612802413; cv=none; d=google.com; s=arc-20160816; b=LaFv7rMSVA/ycltlH2eBFgx2DIMC4n98dbxeuPWI8uZHZro9mHgGaXobHzH/7gtQ1W 4Wa4gk+fuGtV3wF6einFOn32A/pHKNzCAzbmIPsFFxVrSB22cDd+ErituYCODkHciP5U SeSgpXkiK90jvJFJClF+cvsdyqYPwUFYdfMkwnXmSybE3ncCi4RcAYQGjqIbgcWFAPoG Z0xLKG+yu1Ank0siNUME2CNYot1EJvGfvv3pmWSMriV4H8A0CRsaWfEYeAEVHG7/LCEW a2y+abwfChhFhXk4g47qNCEMraIh4Q5KTeEq8cOInrt0nttbEmrfE3JqcS9si4KKwpja BG1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yr5R/cDG0QuWOUV/zdvtyAdTYo318G0hYWm7DOK5FF8=; b=lXMAkCny2WSAv1Sy8udeBookGpLv5Xcre+6KLfw6q14aW6x3IaMZbhgNSXiREhlH9N UcLasP77D11p4XxmrP/NLB/Jsa18fE7xPG7iTfz9Kqg4wrgf39aKM8VKdKyPdrBFM9I3 g2mHkICFJugaoClHspdSTg+hcPiWRHIz0Vp9VremI46WzA8xFLy/a1dl4uu83db0nhKE iHviJuFh4p0kLzS+PPfn2H22TLbJvLr0aS+yUC2c4jTjdqQOIjWEEdI89pnn3na5u1SY hulROp6D02iYvQKOr6Aev82bWprSUx/exNJeSMD7K5mvMzgXk/7ynk5cHTsGMbuqrG0J mziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yOYVebbj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx12si2653415ejb.286.2021.02.08.08.39.48; Mon, 08 Feb 2021 08:40:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yOYVebbj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233625AbhBHQhC (ORCPT + 99 others); Mon, 8 Feb 2021 11:37:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:58920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbhBHPOB (ORCPT ); Mon, 8 Feb 2021 10:14:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE24964EEC; Mon, 8 Feb 2021 15:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797015; bh=RzePf7hV+LpCF+q3I5E782D4lSKVs5lWAKS6C+yPs2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yOYVebbjz6ulw8TXc26Env2HV1WQ8wbNzc/q674A0sxkOz8qDGRwI8P0qF9BpyiS8 y3j2ZkEVsri0CzBrRrwfR/f4SnPNzlo16VfbW5ffGO0y0ttT3mBXJiR175/C4gOelh Epf4arsblK6ptlV5vSHT9NpnpLtlaIZA/WrIKxjo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ikjoon Jang , Chunfeng Yun Subject: [PATCH 5.4 30/65] usb: xhci-mtk: break loop when find the endpoint to drop Date: Mon, 8 Feb 2021 16:01:02 +0100 Message-Id: <20210208145811.392145529@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145810.230485165@linuxfoundation.org> References: <20210208145810.230485165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun commit a50ea34d6dd00a12c9cd29cf7b0fa72816bffbcb upstream. No need to check the following endpoints after finding the endpoint wanted to drop. Fixes: 54f6a8af3722 ("usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints") Cc: stable Reported-by: Ikjoon Jang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1612255104-5363-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-mtk-sch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -689,8 +689,10 @@ void xhci_mtk_drop_ep_quirk(struct usb_h sch_bw = &sch_array[bw_index]; list_for_each_entry_safe(sch_ep, tmp, &sch_bw->bw_ep_list, endpoint) { - if (sch_ep->ep == ep) + if (sch_ep->ep == ep) { destroy_sch_ep(udev, sch_bw, sch_ep); + break; + } } } EXPORT_SYMBOL_GPL(xhci_mtk_drop_ep_quirk);