summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_ktrace.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 91ec8956813..1c38f7f85fc 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_ktrace.c,v 1.45 2008/10/31 17:17:02 deraadt Exp $ */
+/* $OpenBSD: kern_ktrace.c,v 1.46 2008/11/01 21:35:35 pedro Exp $ */
/* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */
/*
@@ -466,11 +466,12 @@ ktrwrite(struct proc *p, struct ktr_header *kth)
aiov[1].iov_len = kth->ktr_len;
auio.uio_resid += kth->ktr_len;
}
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vget(vp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_WRITE(vp, &auio, IO_UNIT|IO_APPEND, p->p_ucred);
- VOP_UNLOCK(vp, 0, p);
- if (!error)
- return 0;
+ if (!error) {
+ vput(vp);
+ return (0);
+ }
/*
* If error encountered, give up tracing on this vnode.
*/
@@ -483,7 +484,8 @@ ktrwrite(struct proc *p, struct ktr_header *kth)
}
}
- return error;
+ vput(vp);
+ return (error);
}
/*