Fix a potentially forever loop.

Found by:	PVS-Studio
This commit is contained in:
Pyun YongHyeon 2017-04-14 02:24:02 +00:00
parent 9f5efe718f
commit 857b699d7e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316805

View File

@ -1696,7 +1696,7 @@ ae_stop_txmac(ae_softc_t *sc)
/*
* Wait for IDLE state.
*/
for (i = 0; i < AE_IDLE_TIMEOUT; i--) {
for (i = 0; i < AE_IDLE_TIMEOUT; i++) {
val = AE_READ_4(sc, AE_IDLE_REG);
if ((val & (AE_IDLE_TXMAC | AE_IDLE_DMAREAD)) == 0)
break;