diff options
author | Patrick Latifi <pat@cvs.openbsd.org> | 2006-06-14 16:48:11 +0000 |
---|---|---|
committer | Patrick Latifi <pat@cvs.openbsd.org> | 2006-06-14 16:48:11 +0000 |
commit | 6fd0b40edc5ceec32185954a2ee1b0cabb6382f1 (patch) | |
tree | 9eaae7ef2f7830200c7cb7d58ece924cc4355162 /sys/isofs/udf/udf_vnops.c | |
parent | a2a2144c3ec65015ce96fe4236be40610800bc52 (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.c | 7 |
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); |