summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorDejin Zheng <zhengdejin5@gmail.com>2020-02-06 18:29:17 +0300
committerDavid S. Miller <davem@davemloft.net>2020-02-07 13:23:34 +0300
commit7d10f0774f9e32aa2f2e012f7fcb312a2ce422b9 (patch)
tree104e83d43c2e97ac2f2f26392b5b93e65411e894 /drivers/net
parent963485d436ccc2810177a7b08af22336ec2af67b (diff)
downloadlinux-7d10f0774f9e32aa2f2e012f7fcb312a2ce422b9.tar.xz
net: stmmac: fix a possible endless loop
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. Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c1
1 files changed, 1 insertions, 0 deletions
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(&ethqos->pdev->dev,