Commit f991a65c authored by Roel Kluin's avatar Roel Kluin Committed by Greg Kroah-Hartman

staging: rtlxxxx: off by one in AsicSendCommandToMcu() and NDIS_STATUS NICLoadFirmware()

With a postfix increment i/Index is incremented beyond 100/1000 so the
message will be displayed too soon.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8d72f98a
...@@ -7866,7 +7866,7 @@ BOOLEAN AsicSendCommandToMcu( ...@@ -7866,7 +7866,7 @@ BOOLEAN AsicSendCommandToMcu(
RTMPusecDelay(2); RTMPusecDelay(2);
} while(i++ < 100); } while(i++ < 100);
if (i >= 100) if (i > 100)
{ {
{ {
#ifdef RT2860 #ifdef RT2860
......
...@@ -3366,7 +3366,7 @@ NDIS_STATUS NICLoadFirmware( ...@@ -3366,7 +3366,7 @@ NDIS_STATUS NICLoadFirmware(
RTMPusecDelay(1000); RTMPusecDelay(1000);
} while (Index++ < 1000); } while (Index++ < 1000);
if (Index >= 1000) if (Index > 1000)
{ {
Status = NDIS_STATUS_FAILURE; Status = NDIS_STATUS_FAILURE;
DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n")); DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment