staging: rtlxxxx: off by one in AsicSendCommandToMcu() and NDIS_STATUS NICLoadFirmware()
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 13 May 2009 18:37:54 +0000 (20:37 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Jun 2009 18:00:51 +0000 (11:00 -0700)
With a postfix increment i/Index is incremented beyond 100/1000 so the
message will be displayed too soon.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rt2860/common/mlme.c
drivers/staging/rt2860/common/rtmp_init.c

index e9e69c5..bb6fccb 100644 (file)
@@ -7866,7 +7866,7 @@ BOOLEAN AsicSendCommandToMcu(
                RTMPusecDelay(2);
        } while(i++ < 100);
 
-       if (i >= 100)
+       if (i > 100)
        {
                {
 #ifdef RT2860
index c2facac..004f530 100644 (file)
@@ -3366,7 +3366,7 @@ NDIS_STATUS NICLoadFirmware(
                RTMPusecDelay(1000);
        } while (Index++ < 1000);
 
-    if (Index >= 1000)
+    if (Index > 1000)
        {
                Status = NDIS_STATUS_FAILURE;
                DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n"));