summaryrefslogtreecommitdiffstats
path: root/sys/gnu/ext2fs/ext2_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/gnu/ext2fs/ext2_vnops.c')
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index ee64c44..c1fcc83 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -1063,7 +1063,8 @@ ext2_symlink(ap)
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, (int *)0,
(struct proc *)0);
- vput(vp);
+ if (error)
+ vput(vp);
return (error);
}
OpenPOWER on IntegriCloud