correct logic so we recognize timeout on alloc
Noticed by: Coverity Prevent analysis tool
This commit is contained in:
parent
e0b3db1059
commit
8967d82340
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user