From ec3ba2c85b4b54d22a7a1ccd12dc8ee6cdc02330 Mon Sep 17 00:00:00 2001 From: dyoung Date: Thu, 2 Jul 2009 02:06:11 +0000 Subject: [PATCH] In vndopen(), release the lock before returning ENXIO. --- sys/dev/vnd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 84be90d0ff70..31144535d396 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: vnd.c,v 1.201 2009/05/07 09:13:13 cegger Exp $ */ +/* $NetBSD: vnd.c,v 1.202 2009/07/02 02:06:11 dyoung Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc. @@ -130,7 +130,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.201 2009/05/07 09:13:13 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.202 2009/07/02 02:06:11 dyoung Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -356,8 +356,10 @@ vndopen(dev_t dev, int flags, int mode, struct lwp *l) if ((error = vndlock(sc)) != 0) return error; - if ((sc->sc_flags & VNF_CLEARING) != 0) - return ENXIO; + if ((sc->sc_flags & VNF_CLEARING) != 0) { + error = ENXIO; + goto done; + } lp = sc->sc_dkdev.dk_label;