Skip to contentSkip to conversation

net: stmmac: fix a possible endless loop

PATCH Superseded Dejin Zheng 2 participants 2 messages Feb 6, 2020

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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")

---

Vinod Koul and David Miller, Thanks for your comments!

V2:
add an appropriate Fixes tag.

 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +1 -0
index 7ec895407d23..e0a5fe83d8e0 100644
@@ -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,
Signature · 1 line
2.25.0
maintainer
#1 lore raw

From: Dejin Zheng <[email protected]>
Date: Thu, 6 Feb 2020 22:18:11 +0800

Quoted 6 lines

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")
Quoted 8 lines

---

Vinod Koul and David Miller, Thanks for your comments!

V2:
add an appropriate Fixes tag.

Please do not put an empty line between Fixes and other tags.

I have no idea why people often do this.

Anyways, Fixes and other tags are all tags and thus belong together as an uninterrupted group of text.

Thank you.