diff mbox series

net: stmmac: fix a possible endless loop

Message ID 20200206132147.22874-1-zhengdejin5@gmail.com (mailing list archive)
State Mainlined
Commit 7d10f0774f9e32aa2f2e012f7fcb312a2ce422b9
Headers show
Series net: stmmac: fix a possible endless loop | expand

Commit Message

Dejin Zheng Feb. 6, 2020, 1:21 p.m. UTC
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 <zhengdejin5@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Miller Feb. 6, 2020, 1:32 p.m. UTC | #1
From: Dejin Zheng <zhengdejin5@gmail.com>
Date: Thu,  6 Feb 2020 21:21:47 +0800

> 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 <zhengdejin5@gmail.com>

Please resubmit this with an appropriate Fixes: tag.

Thank you.
Vinod Koul Feb. 6, 2020, 1:35 p.m. UTC | #2
On 06-02-20, 21:21, Dejin Zheng wrote:
> 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.

Thanks for the fix.

Acked-by: Vinod Koul <vkoul@kernel.org>

We should add:
Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos")

Also, I think this should be CCed stable
David Miller Feb. 6, 2020, 1:37 p.m. UTC | #3
From: Vinod Koul <vkoul@kernel.org>
Date: Thu, 6 Feb 2020 19:05:54 +0530

> On 06-02-20, 21:21, Dejin Zheng wrote:
>> 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.
> 
> Thanks for the fix.
> 
> Acked-by: Vinod Koul <vkoul@kernel.org>
> 
> We should add:
> Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos")
> 
> Also, I think this should be CCed stable

Networking patches do not CC: stable, I queued them up myself manually.

Please read the netdev FAQ under Documentation/ for details.
Vinod Koul Feb. 6, 2020, 1:45 p.m. UTC | #4
On 06-02-20, 14:37, David Miller wrote:
> > 
> > Also, I think this should be CCed stable
> 
> Networking patches do not CC: stable, I queued them up myself manually.
> 
> Please read the netdev FAQ under Documentation/ for details.

Oops sorry I forgot about that part.

Thanks
diff mbox series

Patch

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,