summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_bufs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index 77573709..e30e6de8 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -161,6 +161,12 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
}
map->offset = (unsigned long)map->handle;
if ( map->flags & _DRM_CONTAINS_LOCK ) {
+ /* Prevent a 2nd X Server from creating a 2nd lock */
+ if (dev->lock.hw_lock != NULL) {
+ vfree( map->handle );
+ DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
+ return -EBUSY;
+ }
dev->sigdata.lock =
dev->lock.hw_lock = map->handle; /* Pointer to lock */
}