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