Source-Changes-HG archive

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

[src/riastradh-drm2]: src/sys/external/bsd/drm2/drm Decrement sc_opencount on...



details:   https://anonhg.NetBSD.org/src/rev/3dcea549ee8e
branches:  riastradh-drm2
changeset: 788507:3dcea549ee8e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 15:34:36 2013 +0000

description:
Decrement sc_opencount on drm_close.

diffstat:

 sys/external/bsd/drm2/drm/drm_drv.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 201050abf1e6 -r 3dcea549ee8e sys/external/bsd/drm2/drm/drm_drv.c
--- a/sys/external/bsd/drm2/drm/drm_drv.c       Sun Sep 08 15:34:06 2013 +0000
+++ b/sys/external/bsd/drm2/drm/drm_drv.c       Sun Sep 08 15:34:36 2013 +0000
@@ -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 @@
 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;
 }
 
 /*



Home | Main Index | Thread Index | Old Index