From b27acc8dd19a92a56c43b32a67a1470e22b761f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sun, 10 Jun 2001 21:39:01 +0000 Subject: [PATCH] Bail out if the fill function failed. --- sys/fs/pseudofs/pseudofs_vnops.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index 473b4144f58a..f3170251beb7 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -233,6 +233,11 @@ pfs_read(struct vop_read_args *va) if (proc != NULL) PRELE(proc); + + if (error) { + sbuf_delete(sb); + return (error); + } /* XXX we should possibly detect and handle overflows */ sbuf_finish(sb); @@ -391,6 +396,11 @@ pfs_readlink(struct vop_readlink_args *va) if (proc != NULL) PRELE(proc); + if (error) { + sbuf_delete(&sb); + return (error); + } + /* XXX we should detect and handle overflows */ sbuf_finish(&sb); ps = sbuf_data(&sb) + uio->uio_offset;