summaryrefslogtreecommitdiff
path: root/sys/isofs/udf/udf_vnops.c
diff options
context:
space:
mode:
authorPatrick Latifi <pat@cvs.openbsd.org>2006-06-14 16:48:11 +0000
committerPatrick Latifi <pat@cvs.openbsd.org>2006-06-14 16:48:11 +0000
commit6fd0b40edc5ceec32185954a2ee1b0cabb6382f1 (patch)
tree9eaae7ef2f7830200c7cb7d58ece924cc4355162 /sys/isofs/udf/udf_vnops.c
parenta2a2144c3ec65015ce96fe4236be40610800bc52 (diff)
Avoid potential deadlock during hash lookup; ok pedro@
Diffstat (limited to 'sys/isofs/udf/udf_vnops.c')
-rw-r--r--sys/isofs/udf/udf_vnops.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/isofs/udf/udf_vnops.c b/sys/isofs/udf/udf_vnops.c
index 1aefcb5efd1..f02c7e309ab 100644
--- a/sys/isofs/udf/udf_vnops.c
+++ b/sys/isofs/udf/udf_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vnops.c,v 1.11 2006/01/18 19:27:48 pedro Exp $ */
+/* $OpenBSD: udf_vnops.c,v 1.12 2006/06/14 16:48:10 pat Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -100,8 +100,11 @@ udf_hashlookup(struct udf_mnt *udfmp, ino_t id, int flags, struct vnode **vpp)
loop:
mtx_enter(&udfmp->hash_mtx);
lh = &udfmp->hashtbl[id & udfmp->hashsz];
- if (lh == NULL)
+ if (lh == NULL) {
+ mtx_leave(&udfmp->hash_mtx);
return (ENOENT);
+ }
+
LIST_FOREACH(node, lh, le) {
if (node->hash_id == id) {
mtx_leave(&udfmp->hash_mtx);