Skip to content

Commit

Permalink
net: stmmac: Prevent infinite loop in get_rx_timestamp_status()
Browse files Browse the repository at this point in the history
Prevent infinite loop by correctly setting the loop condition to
break when i == 10.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jose Abreu authored and David S. Miller committed Oct 22, 2017
1 parent 9887094 commit 9454360
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9454360

Please sign in to comment.