summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exec.c4
-rw-r--r--kernel/sysfile.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/exec.c b/kernel/exec.c
index 8a2d1dc..0e8762f 100644
--- a/kernel/exec.c
+++ b/kernel/exec.c
@@ -67,8 +67,10 @@ exec(char *path, char **argv)
// Allocate two pages at the next page boundary.
// Use the second as the user stack.
sz = PGROUNDUP(sz);
- if((sz = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0)
+ uint64 sz1;
+ if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0)
goto bad;
+ sz = sz1;
uvmclear(pagetable, sz-2*PGSIZE);
sp = sz;
stackbase = sp - PGSIZE;
diff --git a/kernel/sysfile.c b/kernel/sysfile.c
index 015c942..5dc453b 100644
--- a/kernel/sysfile.c
+++ b/kernel/sysfile.c
@@ -436,10 +436,9 @@ sys_exec(void)
}
argv[i] = kalloc();
if(argv[i] == 0)
- panic("sys_exec kalloc");
- if(fetchstr(uarg, argv[i], PGSIZE) < 0){
goto bad;
- }
+ if(fetchstr(uarg, argv[i], PGSIZE) < 0)
+ goto bad;
}
int ret = exec(path, argv);