summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorAustin Clements <[email protected]>2010-08-31 21:49:49 -0400
committerAustin Clements <[email protected]>2010-08-31 21:49:49 -0400
commitdd645ef11911596d73d128c1da53579678c56aee (patch)
tree1a2f65aa805829a21c8d65460180a14c385ac005 /vm.c
parent5048762c7e27789a014cc1e74e1002e749c924ce (diff)
downloadxv6-labs-dd645ef11911596d73d128c1da53579678c56aee.tar.gz
xv6-labs-dd645ef11911596d73d128c1da53579678c56aee.tar.bz2
xv6-labs-dd645ef11911596d73d128c1da53579678c56aee.zip
Cleanup if allocuvm fails to alloc. Add a test.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 8a57ca9..95eeca8 100644
--- a/vm.c
+++ b/vm.c
@@ -195,7 +195,8 @@ allocuvm(pde_t *pgdir, char *addr, uint sz)
if(pte == 0 || (*pte & PTE_P) == 0){
char *mem = kalloc();
if(mem == 0){
- // XXX clean up?
+ cprintf("allocuvm out of memory\n");
+ deallocuvm(pgdir, addr, sz);
return 0;
}
memset(mem, 0, PGSIZE);