Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/linux Simplify. Destroy the mutex too.



details:   https://anonhg.NetBSD.org/src/rev/9a9efe1f284b
branches:  trunk
changeset: 366401:9a9efe1f284b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:24:40 2018 +0000

description:
Simplify.  Destroy the mutex too.

diffstat:

 sys/external/bsd/drm2/linux/linux_dma_buf.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 9ae785dc43f4 -r 9a9efe1f284b sys/external/bsd/drm2/linux/linux_dma_buf.c
--- a/sys/external/bsd/drm2/linux/linux_dma_buf.c       Mon Aug 27 15:24:27 2018 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_buf.c       Mon Aug 27 15:24:40 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_buf.c,v 1.2 2018/08/27 15:24:11 riastradh Exp $      */
+/*     $NetBSD: linux_dma_buf.c,v 1.3 2018/08/27 15:24:40 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.2 2018/08/27 15:24:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.3 2018/08/27 15:24:40 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -167,9 +167,9 @@
        if (atomic_dec_uint_nv(&dmabuf->db_refcnt) != 0)
                return;
 
-       if (dmabuf->resv == &dmabuf->db_resv_int[0])
+       mutex_destroy(&dmabuf->db_lock);
+       if (dmabuf->resv == &dmabuf->db_resv_int[0]) {
                reservation_object_fini(dmabuf->resv);
-       if (dmabuf->resv == &dmabuf->db_resv_int[0]) {
                kmem_free(dmabuf, offsetof(struct dma_buf, db_resv_int[1]));
        } else {
                kmem_free(dmabuf, sizeof(*dmabuf));



Home | Main Index | Thread Index | Old Index