Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Fix reference count leak in cons(4).



details:   https://anonhg.NetBSD.org/src/rev/a36a49783304
branches:  trunk
changeset: 846976:a36a49783304
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Dec 06 03:45:33 2019 +0000

description:
Fix reference count leak in cons(4).

Don't forget to vrele after you're done, folks!

XXX pullup-9
XXX pullup-8
XXX pullup-7
XXX pullup-6... 5... 4 might not have had this bug!

diffstat:

 sys/dev/cons.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 1df747ec1ca4 -r a36a49783304 sys/dev/cons.c
--- a/sys/dev/cons.c    Fri Dec 06 02:37:53 2019 +0000
+++ b/sys/dev/cons.c    Fri Dec 06 03:45:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $       */
+/*     $NetBSD: cons.c,v 1.76 2019/12/06 03:45:33 riastradh Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -33,13 +33,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * from: Utah $Hdr: cons.c 1.7 92/01/21$
+ * from: Utah $Hdr$
  *
  *     @(#)cons.c      8.2 (Berkeley) 1/12/94
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.76 2019/12/06 03:45:33 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -158,6 +158,7 @@
        if (error == 0) {
                error = VOP_CLOSE(vp, flag, kauth_cred_get());
                VOP_UNLOCK(vp);
+               vrele(vp);
        }
        return error;
 }



Home | Main Index | Thread Index | Old Index