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 e9e69c539e6f951d850d069fa808b3e4972c9b73..bb6fccbdca41b1dd4feb454e10dc25a675a95e12 100644 (file)
@@ -7866,7 +7866,7 @@ BOOLEAN AsicSendCommandToMcu(
                RTMPusecDelay(2);
        } while(i++ < 100);
 
-       if (i >= 100)
+       if (i > 100)
        {
                {
 #ifdef RT2860
index c2facac5cf88137c42198ec2c97d7d93453a2fe1..004f53023b0f5865440a1638869587ac193515ff 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"));