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.
This commit is contained in:
Jesse Barnes 2007-12-04 14:38:00 -08:00
parent 1a07dd5ffd
commit f7432d187e
2 changed files with 2 additions and 5 deletions

View file

@ -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:

View file

@ -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);