From e670a4835858b48e1568742dbe939800e2d44c13 Mon Sep 17 00:00:00 2001 From: kolya Date: Wed, 15 Oct 2008 17:42:56 +0000 Subject: [PATCH] as rtm noticed, avoid doubly-freeing pipe page --- pipe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pipe.c b/pipe.c index fda3788..8a580f9 100644 --- a/pipe.c +++ b/pipe.c @@ -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