summaryrefslogtreecommitdiff
path: root/kernel/proc.c
diff options
context:
space:
mode:
don't panic if a program frees all its memory with sbrk().
if a program sbrk()'s to a non-page-boundary, don't free that page. corresponding usertests.
Diffstat (limited to 'kernel/proc.c')
-rw-r--r--kernel/proc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/proc.c b/kernel/proc.c
index 786e5c3..0d91a59 100644
--- a/kernel/proc.c
+++ b/kernel/proc.c
@@ -232,9 +232,7 @@ growproc(int n)
return -1;
}
} else if(n < 0){
- if((sz = uvmdealloc(p->pagetable, sz, sz + n)) == 0) {
- return -1;
- }
+ sz = uvmdealloc(p->pagetable, sz, sz + n);
}
p->sz = sz;
return 0;