free proc if kalloc fails

This commit is contained in:
Robert Morris 2020-11-01 11:11:38 -05:00
parent d7c0a1b7a7
commit af570f582c

View file

@ -116,6 +116,7 @@ found:
// Allocate a trapframe page.
if((p->trapframe = (struct trapframe *)kalloc()) == 0){
freeproc(p);
release(&p->lock);
return 0;
}