as rtm noticed, avoid doubly-freeing pipe page
This commit is contained in:
parent
deca9fef83
commit
e670a48358
1 changed files with 4 additions and 3 deletions
5
pipe.c
5
pipe.c
|
@ -69,10 +69,11 @@ pipeclose(struct pipe *p, int writable)
|
||||||
p->readopen = 0;
|
p->readopen = 0;
|
||||||
wakeup(&p->writep);
|
wakeup(&p->writep);
|
||||||
}
|
}
|
||||||
|
if(p->readopen == 0 && p->writeopen == 0) {
|
||||||
release(&p->lock);
|
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
|
||||||
|
|
Loading…
Reference in a new issue