summaryrefslogtreecommitdiff
path: root/sys/compat/common
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2008-08-19 09:49:51 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2008-08-19 09:49:51 +0000
commit0ac07f69256f988f98c6f2ff4c4836b1d9cd0173 (patch)
tree18656f8a768dfba9ea8eae78f87f3d6949c412e1 /sys/compat/common
parentca14c3322004233379ac30fbe3e5b2b9a6b90a16 (diff)
When failing to acquire the vnode lock in readdir_with_callback(), don't
try to release it before returning, okay fgsch@ and tedu@.
Diffstat (limited to 'sys/compat/common')
-rw-r--r--sys/compat/common/compat_dir.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/compat/common/compat_dir.c b/sys/compat/common/compat_dir.c
index 79a66431d10..438b3027915 100644
--- a/sys/compat/common/compat_dir.c
+++ b/sys/compat/common/compat_dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat_dir.c,v 1.4 2003/08/14 16:55:24 fgsch Exp $ */
+/* $OpenBSD: compat_dir.c,v 1.5 2008/08/19 09:49:50 pedro Exp $ */
/*
* Copyright (c) 2000 Constantine Sapuntzakis
@@ -76,8 +76,10 @@ readdir_with_callback(fp, off, nbytes, appendfunc, arg)
buflen = max(buflen, va.va_blocksize);
buf = malloc(buflen, M_TEMP, M_WAITOK);
error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curproc);
- if (error)
- goto out;
+ if (error) {
+ free(buf, M_TEMP);
+ return (error);
+ }
again:
aiov.iov_base = buf;