diff options
Diffstat (limited to 'kalloc.c')
-rw-r--r-- | kalloc.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -27,8 +27,6 @@ void kinit() { initlock(&kmem.lock, "kmem"); - if(PHYSTOP > RAMDISK) - panic("kinit"); freerange(end, (void*)PHYSTOP); } @@ -76,7 +74,7 @@ kalloc(void) if(r) kmem.freelist = r->next; release(&kmem.lock); - memset((char*)r, 5, PGSIZE); // fill with junk + if(r) + memset((char*)r, 5, PGSIZE); // fill with junk return (void*)r; } - |