Fix a potentially "forever" loop.

Found by:	PVS-Studio
This commit is contained in:
Gleb Smirnoff 2016-02-17 21:24:26 +00:00
parent c619ab95b3
commit 7b0c04c29c

View File

@ -1660,7 +1660,7 @@ ae_stop_rxmac(ae_softc_t *sc)
/* /*
* Wait for IDLE state. * 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); val = AE_READ_4(sc, AE_IDLE_REG);
if ((val & (AE_IDLE_RXMAC | AE_IDLE_DMAWRITE)) == 0) if ((val & (AE_IDLE_RXMAC | AE_IDLE_DMAWRITE)) == 0)
break; break;