Module Name:    src
Committed By:   mrg
Date:           Mon Feb 13 01:47:16 UTC 2012

Modified Files:
        src/sys/dev: sequencer.c

Log Message:
call VOP_CLOSE() in the case we're bailing due to missing both read/write.
fixes vrelel() warnings when opening /dev/music on a device that doesn't
support the requested open flags.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/sequencer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sequencer.c
diff -u src/sys/dev/sequencer.c:1.53 src/sys/dev/sequencer.c:1.54
--- src/sys/dev/sequencer.c:1.53	Wed Nov 23 23:07:31 2011
+++ src/sys/dev/sequencer.c	Mon Feb 13 01:47:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequencer.c,v 1.53 2011/11/23 23:07:31 jmcneill Exp $	*/
+/*	$NetBSD: sequencer.c,v 1.54 2012/02/13 01:47:16 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.53 2011/11/23 23:07:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.54 2012/02/13 01:47:16 mrg Exp $");
 
 #include "sequencer.h"
 
@@ -1326,6 +1326,7 @@ midiseq_open(int unit, int flags)
 	int major;
 	dev_t dev;
 	vnode_t *vp;
+	int oflags;
 	
 	major = devsw_name2chr("midi", NULL, 0);
 	dev = makedev(major, unit);
@@ -1345,9 +1346,11 @@ midiseq_open(int unit, int flags)
 
 	/* Only after we have acquired reference via VOP_OPEN(). */
 	midi_getinfo(dev, &mi);
+	oflags = flags;
 	if ((mi.props & MIDI_PROP_CAN_INPUT) == 0)
 	        flags &= ~FREAD;
 	if ((flags & (FREAD|FWRITE)) == 0) {
+		VOP_CLOSE(vp, oflags, kauth_cred_get());
 		vrele(vp);
 	        return NULL;
 	}

Reply via email to