]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: stmmac: fix a possible endless loop
authorDejin Zheng <zhengdejin5@gmail.com>
Thu, 6 Feb 2020 15:29:17 +0000 (23:29 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Feb 2020 10:23:34 +0000 (11:23 +0100)
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>
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

index 7ec895407d232b7d4656479eea38856559800478..e0a5fe83d8e0e8a35210a05293f9f922201c3d3b 100644 (file)
@@ -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,