summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-01-26 14:21:00 +0000
committerkib <kib@FreeBSD.org>2009-01-26 14:21:00 +0000
commit3f74998bc8152702e7d8b9ce8cb484c112a9f83c (patch)
tree1bd4bf933545fce94e7f49dbefd1cb99be1ec3b2 /sys/fs
parent3b0fbe380002ff733e00cb220d235c309d47edae (diff)
downloadFreeBSD-src-3f74998bc8152702e7d8b9ce8cb484c112a9f83c.zip
FreeBSD-src-3f74998bc8152702e7d8b9ce8cb484c112a9f83c.tar.gz
The kernel may do unbalanced calls to fifo_close() for fifo vnode,
without corresponding number of fifo_open(). This causes assertion failure in fifo_close() due to vp->v_fifoinfo being NULL for kernel with INVARIANTS, or NULL pointer dereference otherwise. In fact, we may ignore excess calls to fifo_close() without bad consequences. Turn KASSERT() into the return, and print warning for now. Tested by: pho Reviewed by: rwatson MFC after: 2 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/fifofs/fifo_vnops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index a875c05..bd3a621 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -423,7 +423,10 @@ fifo_close(ap)
struct fifoinfo *fip = vp->v_fifoinfo;
ASSERT_VOP_LOCKED(vp, "fifo_close");
- KASSERT(fip != NULL, ("fifo_close: no v_fifoinfo"));
+ if (fip == NULL) {
+ printf("fifo_close: no v_fifoinfo %p\n", vp);
+ return (0);
+ }
if (ap->a_fflag & FREAD) {
fip->fi_readers--;
if (fip->fi_readers == 0)
OpenPOWER on IntegriCloud