Skip to content
Snippets Groups Projects
Commit e670a483 authored by kolya's avatar kolya
Browse files

as rtm noticed, avoid doubly-freeing pipe page

parent deca9fef
No related branches found
No related tags found
No related merge requests found
......@@ -69,10 +69,11 @@ pipeclose(struct pipe *p, int writable)
p->readopen = 0;
wakeup(&p->writep);
}
release(&p->lock);
if(p->readopen == 0 && p->writeopen == 0)
if(p->readopen == 0 && p->writeopen == 0) {
release(&p->lock);
kfree((char*)p, PAGE);
} else
release(&p->lock);
}
//PAGEBREAK: 30
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment