Skip to contentSkip to conversation

rt2860: test off by one in RtmpAsicSendCommandToMcu()

PATCH New Roel Kluin 1 participant 1 message Dec 26, 2009 Staging

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 rt2860: test off by one in RtmpAsicSendCommandToMcu()

`i' reaches 101 after the loop, so if it was 100 then it succeeded in the last iteration. This is probably unlikely to cause problems.

---
 drivers/staging/rt2860/common/rtmp_mcu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/rt2860/common/rtmp_mcu.c +1 -1
index 9f03901..e80f587 100644
@@ -221,7 +221,7 @@ int RtmpAsicSendCommandToMcu(struct rt_rtmp_adapter *pAd,
 				 ("AsicSendCommanToMcu::Mail box is busy\n"));
 		} while (i++ < 100);
 
-		if (i >= 100) {
+		if (i > 100) {
 			DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n"));
 			return FALSE;
 		}