From f797fcd526614637a87aa23af6b70ef2c599a94d Mon Sep 17 00:00:00 2001 From: Sunil Paidimarri Date: Tue, 26 May 2020 16:18:23 -0700 Subject: [PATCH] net: stmmac: fix a possible endless loop Port a fix from 5.4. 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. Change-Id: Icf3887476de6bee7976eb020d18fc9f733324599 Acked-by: Vinod Koul Signed-off-by: Sunil Paidimarri --- 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 ed6981aaf774..afadf7232079 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -862,6 +862,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,