From: pedro Date: Tue, 19 Aug 2008 09:49:50 +0000 (+0000) Subject: When failing to acquire the vnode lock in readdir_with_callback(), don't X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=87bfc5c7716d37d2ae141fd3ef6e5209dd163c34;p=openbsd When failing to acquire the vnode lock in readdir_with_callback(), don't try to release it before returning, okay fgsch@ and tedu@. --- 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;