From 41d3727d7ede47845cde383826fa319f0e78f11e Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 12 May 2013 19:06:02 +0800 Subject: [PATCH] Modules/E1000 - Fixed corruption/crash --- KernelLand/Modules/Network/E1000/e1000.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/KernelLand/Modules/Network/E1000/e1000.c b/KernelLand/Modules/Network/E1000/e1000.c index 66c1c863..fc657a1e 100644 --- a/KernelLand/Modules/Network/E1000/e1000.c +++ b/KernelLand/Modules/Network/E1000/e1000.c @@ -118,8 +118,11 @@ void E1000_int_ReleaseRXD(void *Arg, size_t HeadLen, size_t FootLen, const void { tCard **cardptr = Arg; tCard *Card = *cardptr; - int rxd = (Arg - (void*)Card->RXDescs) / sizeof(tRXDesc); - + int rxd = (Arg - (void*)Card->RXBackHandles) / sizeof(void*); + + LOG("RXD %p %i being released", Card, rxd); + ASSERT(rxd >= 0 && rxd < NUM_RX_DESC); + Card->RXDescs[rxd].Status = 0; Mutex_Acquire(&Card->lRXDescs); if( rxd == REG32(Card, REG_RDT) ) { -- 2.20.1