free proc if kalloc fails
This commit is contained in:
parent
5e392531c0
commit
b48ea5d220
1 changed files with 1 additions and 0 deletions
|
@ -116,6 +116,7 @@ found:
|
||||||
|
|
||||||
// Allocate a trapframe page.
|
// Allocate a trapframe page.
|
||||||
if((p->trapframe = (struct trapframe *)kalloc()) == 0){
|
if((p->trapframe = (struct trapframe *)kalloc()) == 0){
|
||||||
|
freeproc(p);
|
||||||
release(&p->lock);
|
release(&p->lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue