Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1602637ybv; Thu, 6 Feb 2020 06:48:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwTYAcLoJAABEUN93V57z8yWRq6LZFYa2NEWq8/aBqZ/EPKcLDMV5jkaz64Ms3DA7lIEYV8 X-Received: by 2002:a9d:545:: with SMTP id 63mr31934995otw.285.1581000498965; Thu, 06 Feb 2020 06:48:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581000498; cv=none; d=google.com; s=arc-20160816; b=eA1ax40oUUz6l0G89dRL4GzCSf1eQh6ULmzo+5D4zTqoKnva8PBI9FDP7VLQEKyPnn eAsC3x503bHVCxIvII/ljjPUOzwYVTUHpK/BljR8wseNAuY4ai2zfOmMj1sI7KaeqV7k 253db4Nva9JluNsmnyqyS5T8t2ZErFG1393lnodyz6nNgVL9UKY5vqrfaglf+uI0Lr3B /VY/RKlOnSOmd0OwOYU2UGV0RWfKsPXw99xvUzk0/jdZguVzLMWYCXJR8w3KkuR0YO0F O9uGLrmpFPDTey2/8o+iwu3YuEhvPYaeUkTRwi7fkMsyUhVdSZ+1sTnz0gdsrOghB0sd RJPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MMEdhBkwc3vUygsidCCQyAeg+NALFLEwybGyK66dnDM=; b=G5eSAEiMR8dCbNg4cfg1/bVk8dtCqKCaUwVaUicEfzJU7TCnSWUN3NfVGz6Rc+xXOA 75zqUN6mwZILApZB2PrGl5CniKZKxfJAOT6SOAbu2gbgMx8ARyO+Ov51jwjSR5ctOz1+ JSZvdnRO2vXRMK28890d+4RPudoy4IE51sIDRoTPu2fsC4suk8NgTi6zXZZh7964Va1U w04CGPoU0tcBtDX/ZMDdhn9XdMU6hTwDMqNyyZC7dQ2HLWQHQzLq5zZGsbENsmP4Ra5G Eccy2HHXoE38uUylDV8PrkpUewfIASCxrCYZAiuECI46m7zLRX3ywRGAorgpJdV0bsAq F97w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ThufnkVc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id x16si1884579otp.184.2020.02.06.06.48.05; Thu, 06 Feb 2020 06:48:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ThufnkVc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727895AbgBFNWF (ORCPT + 99 others); Thu, 6 Feb 2020 08:22:05 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:38057 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727847AbgBFNWF (ORCPT ); Thu, 6 Feb 2020 08:22:05 -0500 Received: by mail-pj1-f67.google.com with SMTP id j17so2550574pjz.3; Thu, 06 Feb 2020 05:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MMEdhBkwc3vUygsidCCQyAeg+NALFLEwybGyK66dnDM=; b=ThufnkVcDU19LYejj+ltE3+1XMcAoY8Q+5t0KjvrkpxTrDaeOXYjjmvDvZN/xss2zg c51VN03oWDQJKeGWbijzI7CpMn4Nl1RO0c2uNhdpZURO1rGkaTGV1iXXXzZ1QvutbMy/ LVSnZCHO4RmjIfUno4drB63Z33CNnlrYz3D/AATMdEg4kyx06lZ8PFkMMpjr3z3WV7/o Xq50QheauxttDJWQN971cFp4SWsyZM8Lr+bYDGY2svzGNgyZNzEGW6iPJF9bjJAE56Zo Th03yl9mlf985Cb/6oqKI6vrQhaMtcEGDcIAD0cp2d1QEt8m6fMtG1fniOeoygtxEInx JHYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MMEdhBkwc3vUygsidCCQyAeg+NALFLEwybGyK66dnDM=; b=VLPM9TFk/3uWy+W+fpOCeBAvxGnSsZS+j52KXEVtIs7D1bjKO268CH+92rvmaY7vg8 xXwC+7UG2I2Tc4L3QOM3LDoJwO3/qKmNjExiIlTws4GDWJXOje4v45JGUzMz2jwxUE9h lw5vEQHX/U7Zq6Y9fdVFUuNEeFn9K0YvMRls9EvK/VVUB3cdgeCKDIAGdGj8I0AX6V3Q slIwoLuP6C5YSroXf28Yvw5/+L9HeoFfC3vyorkYr/HtYexi4s/8snPAeUh9erla8J0n K6610wMzjOHG0hEZL/UYvW4QzlPKIaEcMdu79SV8Ut8V/elRIXsEUP5xYGaqcD/v/vGL I0eg== X-Gm-Message-State: APjAAAV8pA+93SlTRz31Px36VqxdiZD9R+ZI3R4iqQy/peEfohTp0nr/ 2GpzypEMv92ZBgpDy2+Z0bc= X-Received: by 2002:a17:902:680c:: with SMTP id h12mr3688016plk.102.1580995324525; Thu, 06 Feb 2020 05:22:04 -0800 (PST) Received: from localhost (104.128.80.227.16clouds.com. [104.128.80.227]) by smtp.gmail.com with ESMTPSA id f9sm3306849pfd.141.2020.02.06.05.22.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Feb 2020 05:22:04 -0800 (PST) From: Dejin Zheng To: vkoul@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net, mcoquelin.stm32@gmail.com Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH] net: stmmac: fix a possible endless loop Date: Thu, 6 Feb 2020 21:21:47 +0800 Message-Id: <20200206132147.22874-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It forgot to reduce the value of the variable retry in a while loop in the ethqos_configure() function. It may cause an endless loop and without timeout. Signed-off-by: Dejin Zheng --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 7ec895407d23..e0a5fe83d8e0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -413,6 +413,7 @@ static int ethqos_configure(struct qcom_ethqos *ethqos) dll_lock = rgmii_readl(ethqos, SDC4_STATUS); if (dll_lock & SDC4_STATUS_DLL_LOCK) break; + retry--; } while (retry > 0); if (!retry) dev_err(ðqos->pdev->dev, -- 2.25.0