summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-03-26 23:43:54 +0000
committersam <sam@FreeBSD.org>2005-03-26 23:43:54 +0000
commit8967d82340e60a1d5dce64f763dab5d9b45b4a92 (patch)
treeeaa66c177175f1ca9bf704b7a0a5ffe7a8b218fb /sys/dev/wi
parente0b3db10591eea35664f6aa72c8d9671a80c0e79 (diff)
downloadFreeBSD-src-8967d82340e60a1d5dce64f763dab5d9b45b4a92.zip
FreeBSD-src-8967d82340e60a1d5dce64f763dab5d9b45b4a92.tar.gz
correct logic so we recognize timeout on alloc
Noticed by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/dev/wi')
-rw-r--r--sys/dev/wi/if_wi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index ca49c96..66b5598 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -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;
OpenPOWER on IntegriCloud