From: John Hodge Date: Sun, 11 Aug 2013 03:11:34 +0000 (+0800) Subject: Modules/PRO100 - Fixed -ve array reference X-Git-Tag: rel0.15~275 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=13f6e43bd202691b72e1d17806d575d1935c6f13;p=tpg%2Facess2.git Modules/PRO100 - Fixed -ve array reference --- diff --git a/KernelLand/Modules/Network/PRO100/main.c b/KernelLand/Modules/Network/PRO100/main.c index db768445..7a017ebf 100644 --- a/KernelLand/Modules/Network/PRO100/main.c +++ b/KernelLand/Modules/Network/PRO100/main.c @@ -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);