Module Name:    src
Committed By:   riastradh
Date:           Sun Sep  8 15:34:36 UTC 2013

Modified Files:
        src/sys/external/bsd/drm2/drm [riastradh-drm2]: drm_drv.c

Log Message:
Decrement sc_opencount on drm_close.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/sys/external/bsd/drm2/drm/drm_drv.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/external/bsd/drm2/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.1.2.22 src/sys/external/bsd/drm2/drm/drm_drv.c:1.1.2.23
--- src/sys/external/bsd/drm2/drm/drm_drv.c:1.1.2.22	Wed Jul 24 04:05:00 2013
+++ src/sys/external/bsd/drm2/drm/drm_drv.c	Sun Sep  8 15:34:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.1.2.22 2013/07/24 04:05:00 riastradh Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.1.2.23 2013/09/08 15:34:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.1.2.22 2013/07/24 04:05:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.1.2.23 2013/09/08 15:34:36 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -489,9 +489,15 @@ static int
 drm_close(struct file *fp)
 {
 	struct drm_file *const file = fp->f_data;
+	struct drm_softc *const sc = device_private(file->minor->kdev);
+	int error;
+
+	KASSERT(0 < sc->sc_opencount);
 
 	/* XXX errno Linux->NetBSD */
-	return -drm_close_file(file);
+	error = -drm_close_file(file);
+	atomic_dec_uint(&sc->sc_opencount);
+	return error;
 }
 
 /*

Reply via email to