Modules/PRO100 - Fixed -ve array reference
authorJohn Hodge <[email protected]>
Sun, 11 Aug 2013 03:11:34 +0000 (11:11 +0800)
committerJohn Hodge <[email protected]>
Sun, 11 Aug 2013 03:11:34 +0000 (11:11 +0800)
KernelLand/Modules/Network/PRO100/main.c

index db76844..7a017eb 100644 (file)
@@ -205,7 +205,8 @@ tIPStackBuffer *PRO100_WaitForPacket(void *Ptr)
        } while( Card->RXBufs[Card->CurRXIndex]->CU.Status == 0 );
        // Mark previous buffer as suspend (stops the RX unit running into old packets
        Card->RXBufs[ (Card->CurRXIndex-1+NUM_RX)%NUM_RX ]->CU.Command |= CMD_Suspend;
-       tRXBuffer *buf = Card->RXBufs[Card->CurRXIndex++];
+       tRXBuffer *buf = Card->RXBufs[Card->CurRXIndex];
+       Card->CurRXIndex = (Card->CurRXIndex+1) % NUM_RX;
        
        // Return packet (freed in PRO100_ReleaseRXBuf);
        tIPStackBuffer  *ret = IPStack_Buffer_CreateBuffer(1);

UCC git Repository :: git.ucc.asn.au