From: Jose Abreu Date: Fri, 20 Oct 2017 13:37:36 +0000 (+0100) Subject: net: stmmac: Prevent infinite loop in get_rx_timestamp_status() X-Git-Tag: v4.14-rc6~11^2~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9454360dec1c96800576693955b92a2792b74def;p=platform%2Fkernel%2Flinux-exynos.git net: stmmac: Prevent infinite loop in get_rx_timestamp_status() Prevent infinite loop by correctly setting the loop condition to break when i == 10. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c index e0ef02f..4b286e2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c @@ -275,7 +275,7 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, u32 ats) goto exit; i++; - } while ((ret == 1) || (i < 10)); + } while ((ret == 1) && (i < 10)); if (i == 10) ret = -EBUSY;