Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2644522pxb; Fri, 5 Nov 2021 02:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOY7y3cacIZ6O4ATmu+mJnkPXTwnG1/TnUcBAHkobhU+k9ErnK/KCvvcsci/Gi4nPBTg5A X-Received: by 2002:a05:6e02:1561:: with SMTP id k1mr16080583ilu.135.1636103253505; Fri, 05 Nov 2021 02:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636103253; cv=none; d=google.com; s=arc-20160816; b=E+2Xhe89xcd5mVdVeMW0iacvd60mmxa1UOtCXDYAMinwK/aaIDMsbEueGJo6uflKh2 qNowwUpapNnyBvMkK+NnS3ATcD11AhtJRQjsYneaIscn7JUqzzqgARMU3vjtOuFHxCif ZBd0qQSjT+cvLAWaAvNom8nr0sVwyXfhwALS//a+9bKFT/ppnacwzphxbrdQ40OuLONV mV1dFjiAZ4vkub+sn8Ejev12IBVVqdykCdaEDWKa6mQ7on3S7k1R3esIouOIamxUpx5z ioJORN7VNWmM6rudiz9O70in1KSWOuaOQN85CZvmanXAYXa5ZqQIdikybc5wnevuNLIp d91g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=fNnCfv17plgKh9RNsKdF3tZqrD2oD4lNYpmjRFX5TC0=; b=iWpPsDPymxs+zbrzP0xZizc9b5ChzyUKuYQns0cN1JIAzTG3Au8SNu9Gc5lbf7tmvj YfpHMsJFtiRAYvey3F/CiizQp4vdj3eQCP9cGbUgqVYCfSvfJpfmpFs8NnQKayp7nhiw Xx/S0UtiCRfyjCvYjjXWypNgVflBTbQE0zh7+H9GPOdeJHRUU04WD/VHBqPcvf9rMbB4 WYsvNapGNw/aNZJoX0M5BGrqS+P9GG65nHRx4wCzjaUFqv9PFPYNVOrWFABP4GHP1nEi 3ifmW7wFVbt9hshtBC+CFJFzG9afsarhQ5lFqR5NvDsrH3t2wthg1X65yhJZ/gT7MInR i+oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cn96VUtr; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si15304882iow.47.2021.11.05.02.07.19; Fri, 05 Nov 2021 02:07:33 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=cn96VUtr; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbhKEIhF (ORCPT + 99 others); Fri, 5 Nov 2021 04:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbhKEIhF (ORCPT ); Fri, 5 Nov 2021 04:37:05 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3312C061714; Fri, 5 Nov 2021 01:34:25 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id x64so8280974pfd.6; Fri, 05 Nov 2021 01:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fNnCfv17plgKh9RNsKdF3tZqrD2oD4lNYpmjRFX5TC0=; b=cn96VUtrtEe34v4CwSgeMXiGkGdooCbrZ0WLupMfeQlAypP4rqpFmiI/UZKdR+tGoi W+EBLnPRWqojIJBGO+kiDtUXC9vusPwTL4SygJxYvUc22hauOsnColL9XRHOdJUBqc3A HFPUCdx70rh5c0jVRo2HzRyV13JkD9/WWfb2DVXYjz7Ua1ALAZTFAUjtSFMxbYgCaZ56 CJUwhm96o1mQyefRxPrM397pNScFtrYcRcLsfOPnWvvXeQuIYrsg5dPWBNqz5L9yC9Tm cZ/L/WFFnVhveZt0RHm4daCN8ccStZSblyCIPMYmbGtFbGBwzA5Guhh3ianp00C/IG/t 38Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fNnCfv17plgKh9RNsKdF3tZqrD2oD4lNYpmjRFX5TC0=; b=PC04EUxh0LerBO1Pe+gqbDWzq7W5WrwoUihgkl38A4g3faTIv+c/3myMUQIl7ReHgj jOs88DBpfIlQQ7kc8RqgQEGAMWN+ILY8zgfN8QUFCAQIlKDxnTjZcpn401wbGjn5zU0c 0mtulUMLYerlsMsMGINLmLWOC+F40hYvgXAMShAWAOD/QIeipStugpMyjf/tObtU8q1e vYBTRCksVHEZIUSzu/JNZzsdX2bJ0xdxpjp4U9CWUtbAMcco3T37zj6vSXLCgYXwtXSA 6uIOhud5rB5S1aw9haKaIoAJbfmVt7+xE279ATCudCDzTzxpVZCu531BvQpGh3D/+F08 0Wxg== X-Gm-Message-State: AOAM5335UJmqtYs3JPfvDs4uELtVS317UdgJbuf+eMsVIErA09bE4xZN eJYP4yxJ9Lef+FxQhAVEhIM= X-Received: by 2002:a62:3084:0:b0:494:65fa:64f with SMTP id w126-20020a623084000000b0049465fa064fmr9472782pfw.22.1636101265574; Fri, 05 Nov 2021 01:34:25 -0700 (PDT) Received: from ELIJAHBAI-MB0.tencent.com ([103.7.29.31]) by smtp.gmail.com with ESMTPSA id x13sm5599845pgt.80.2021.11.05.01.34.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Nov 2021 01:34:25 -0700 (PDT) From: Haimin Zhang X-Google-Original-From: Haimin Zhang To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: Haimin Zhang , TCS Robot Subject: [PATCH 2/2] USB: ehci_brcm_hub_control: replace wIndex-1 with temp Date: Fri, 5 Nov 2021 16:33:57 +0800 Message-Id: <20211105083357.29715-1-tcs_kernel@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function `ehci_brcm_hub_control`, like following code, it filters out the case where the upper byte of wIndex is nonzero, so it need be replaced with temp. ``` if ((typeReq == GetPortStatus) && (wIndex && wIndex <= ports) && // need to be replaced ehci->reset_done[wIndex-1] && time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && (ehci_readl(ehci, status_reg) & PORT_RESUME)) { ``` Signed-off-by: Haimin Zhang Reported-by: TCS Robot --- drivers/usb/host/ehci-brcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-brcm.c b/drivers/usb/host/ehci-brcm.c index a1e3290e5459..efcfca162126 100644 --- a/drivers/usb/host/ehci-brcm.c +++ b/drivers/usb/host/ehci-brcm.c @@ -73,9 +73,9 @@ static int ehci_brcm_hub_control( * of RESUME */ if ((typeReq == GetPortStatus) && - (wIndex && wIndex <= ports) && - ehci->reset_done[wIndex-1] && - time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && + (temp < ports) && + ehci->reset_done[temp] && + time_after_eq(jiffies, ehci->reset_done[temp]) && (ehci_readl(ehci, status_reg) & PORT_RESUME)) { /* -- 2.30.1 (Apple Git-130)