summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpat <pat@openbsd.org>2006-06-14 16:48:10 +0000
committerpat <pat@openbsd.org>2006-06-14 16:48:10 +0000
commitfc8d56caddf21abb721b233dc0c101ddf33217c5 (patch)
tree24691e4128aa2b6d6fefdbe03d211091ff20494a
parentPlug memory leak in error path; ok pedro@ (diff)
downloadwireguard-openbsd-fc8d56caddf21abb721b233dc0c101ddf33217c5.tar.xz
wireguard-openbsd-fc8d56caddf21abb721b233dc0c101ddf33217c5.zip
Avoid potential deadlock during hash lookup; ok pedro@
-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);