diff --git a/sys/kern/palloc.c b/sys/kern/palloc.c index 9d7f56a..e958f6c 100644 --- a/sys/kern/palloc.c +++ b/sys/kern/palloc.c @@ -171,13 +171,16 @@ PAlloc_AllocPage() Spinlock_Lock(&pallocLock); pg = LIST_FIRST(&freeList); + ASSERT(pg != NULL); LIST_REMOVE(pg, entries); + ASSERT(pg->magic == FREEPAGE_MAGIC_FREE); + info = PAllocGetInfo(pg); + ASSERT(info != NULL); ASSERT(info->refCount == 0); info->refCount++; - ASSERT(pg->magic == FREEPAGE_MAGIC_FREE); pg->magic = FREEPAGE_MAGIC_INUSE; freePages--;