summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJesse Barnes <jesse.barnes@intel.com>2007-12-04 14:38:00 -0800
committerJesse Barnes <jesse.barnes@intel.com>2007-12-04 14:38:00 -0800
commitf7432d187e4b5e13c9e450bf12d5ab8c18ea5146 (patch)
tree24aefc4570033c47665baacb86a4f5e939e8a047 /linux-core
parent1a07dd5ffd014aae8f767ab1f5166131aa27ef3f (diff)
Don't free driver mapped locks
This fix is actually a bit of a cleanup too--it moves lock freeing to drm_rmmap_locked and out of drm_lastclose. This makes it symmetrical with addmap and also prevents the lock from being incorrectly freed from driver mappings.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_bufs.c2
-rw-r--r--linux-core/drm_drv.c5
2 files changed, 2 insertions, 5 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index bfd3dd3d..967e9a2d 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -413,6 +413,8 @@ int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
case _DRM_SHM:
vfree(map->handle);
dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
+ dev->lock.file_priv = NULL;
+ wake_up_interruptible(&dev->lock.lock_queue);
break;
case _DRM_AGP:
case _DRM_SCATTER_GATHER:
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 6a3e7041..a88ae8b5 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -276,11 +276,6 @@ int drm_lastclose(struct drm_device * dev)
if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))
drm_dma_takedown(dev);
- if (dev->lock.hw_lock) {
- dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
- dev->lock.file_priv = NULL;
- wake_up_interruptible(&dev->lock.lock_queue);
- }
dev->dev_mapping = NULL;
mutex_unlock(&dev->struct_mutex);