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/dist/drm/nouveau/nvkm/subdev/mmu Destr...



details:   https://anonhg.NetBSD.org/src/rev/6994b288794b
branches:  trunk
changeset: 366531:6994b288794b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Sep 01 04:38:22 2018 +0000

description:
Destroy mutex before freeing memory.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c |  14 ++++++++-
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r bd93b7c772f8 -r 6994b288794b sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c     Sat Sep 01 04:35:03 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c     Sat Sep 01 04:38:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.3 2018/08/27 07:41:19 riastradh Exp $       */
+/*     $NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.4 2018/09/01 04:38:22 riastradh Exp $       */
 
 /*
  * Copyright 2010 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.3 2018/08/27 07:41:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.4 2018/09/01 04:38:22 riastradh Exp $");
 
 #include "priv.h"
 
@@ -436,6 +436,11 @@
 
        vm->pgt  = vzalloc((vm->lpde - vm->fpde + 1) * sizeof(*vm->pgt));
        if (!vm->pgt) {
+#ifdef __NetBSD__
+               linux_mutex_destroy(&vm->mutex);
+#else
+               mutex_destroy(&vm->mutex);
+#endif
                kfree(vm);
                return -ENOMEM;
        }
@@ -444,6 +449,11 @@
                           block >> 12);
        if (ret) {
                vfree(vm->pgt);
+#ifdef __NetBSD__
+               linux_mutex_destroy(&vm->mutex);
+#else
+               mutex_destroy(&vm->mutex);
+#endif
                kfree(vm);
                return ret;
        }



Home | Main Index | Thread Index | Old Index