From f2ec6777bd530f949c235d7f0386286314a2f601 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Thu, 13 Aug 2020 14:10:58 -0400 Subject: fix a bug in the out-of-memory handling code in exec --- kernel/vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'kernel/vm.c') diff --git a/kernel/vm.c b/kernel/vm.c index 2f3789f..bccb405 100644 --- a/kernel/vm.c +++ b/kernel/vm.c @@ -235,8 +235,7 @@ uvmalloc(pagetable_t pagetable, uint64 oldsz, uint64 newsz) return oldsz; oldsz = PGROUNDUP(oldsz); - a = oldsz; - for(; a < newsz; a += PGSIZE){ + for(a = oldsz; a < newsz; a += PGSIZE){ mem = kalloc(); if(mem == 0){ uvmdealloc(pagetable, a, oldsz); -- cgit v1.2.3