correct logic so we recognize timeout on alloc

Noticed by:	Coverity Prevent analysis tool
This commit is contained in:
sam 2005-03-26 23:43:54 +00:00
parent e0b3db1059
commit 8967d82340

View File

@ -2618,12 +2618,12 @@ wi_alloc_fid(struct wi_softc *sc, int len, int *idp)
for (i = 0; i < WI_TIMEOUT; i++) {
if (CSR_READ_2(sc, WI_EVENT_STAT) & WI_EV_ALLOC)
break;
if (i == WI_TIMEOUT) {
device_printf(sc->sc_dev, "timeout in alloc\n");
return ETIMEDOUT;
}
DELAY(1);
}
if (i == WI_TIMEOUT) {
device_printf(sc->sc_dev, "timeout in alloc\n");
return ETIMEDOUT;
}
*idp = CSR_READ_2(sc, WI_ALLOC_FID);
CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_ALLOC);
return 0;