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 Unlock before vfree/kfree, wh...



details:   https://anonhg.NetBSD.org/src/rev/4689b47d982e
branches:  trunk
changeset: 1027839:4689b47d982e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 00:55:51 2021 +0000

description:
Unlock before vfree/kfree, which can sleep, not after.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_bufs.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 0d9da0919336 -r 4689b47d982e sys/external/bsd/drm2/dist/drm/drm_bufs.c
--- a/sys/external/bsd/drm2/dist/drm/drm_bufs.c Sun Dec 19 00:55:43 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_bufs.c Sun Dec 19 00:55:51 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_bufs.c,v 1.14 2021/12/19 00:49:43 riastradh Exp $  */
+/*     $NetBSD: drm_bufs.c,v 1.15 2021/12/19 00:55:51 riastradh Exp $  */
 
 /*
  * Legacy: Generic DRM Buffer Management
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_bufs.c,v 1.14 2021/12/19 00:49:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_bufs.c,v 1.15 2021/12/19 00:55:51 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/log2.h>
@@ -264,9 +264,9 @@
                        /* Prevent a 2nd X Server from creating a 2nd lock */
                        spin_lock(&dev->primary->master->lock.spinlock);
                        if (dev->master->lock.hw_lock != NULL) {
+                               spin_unlock(&dev->master->lock.spinlock);
                                vfree(map->handle);
                                kfree(map);
-                               spin_unlock(&dev->master->lock.spinlock);
                                return -EBUSY;
                        }
                        spin_unlock(&dev->primary->master->lock.spinlock);



Home | Main Index | Thread Index | Old Index