as rtm noticed, avoid doubly-freeing pipe page

This commit is contained in:
kolya 2008-10-15 17:42:56 +00:00
parent deca9fef83
commit e670a48358

7
pipe.c
View file

@ -69,10 +69,11 @@ pipeclose(struct pipe *p, int writable)
p->readopen = 0; p->readopen = 0;
wakeup(&p->writep); wakeup(&p->writep);
} }
release(&p->lock); if(p->readopen == 0 && p->writeopen == 0) {
release(&p->lock);
if(p->readopen == 0 && p->writeopen == 0)
kfree((char*)p, PAGE); kfree((char*)p, PAGE);
} else
release(&p->lock);
} }
//PAGEBREAK: 30 //PAGEBREAK: 30