aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_fops.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@panoply-rh.(none)>2008-03-17 16:33:15 +1000
committerDave Airlie <airlied@panoply-rh.(none)>2008-03-17 16:38:17 +1000
commite6be93b2a6f508b2284a6d352f5f0640ef1a542a (patch)
tree1ea83f553278f1af2a186a3823d3c0a1e63fc347 /linux-core/drm_fops.c
parentd1513528d7e1a7bd119468087baa6839897627f4 (diff)
drm: pick correct master for cleaning up
When a master is exiting, make sure we clean it up and not the currently in charge master.
Diffstat (limited to 'linux-core/drm_fops.c')
-rw-r--r--linux-core/drm_fops.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 0ca43824..d5c59b19 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -488,13 +488,15 @@ int drm_release(struct inode *inode, struct file *filp)
if (drm_core_check_feature(dev, DRIVER_MODESET))
drm_fb_release(filp);
- file_priv->master = NULL;
-
if (file_priv->is_master) {
- drm_put_master(file_priv->minor->master);
- file_priv->minor->master = NULL;
+ if (file_priv->minor->master == file_priv->master)
+ file_priv->minor->master = NULL;
+ drm_put_master(file_priv->master);
}
+ file_priv->master = NULL;
+ file_priv->is_master = 0;
+
mutex_lock(&dev->struct_mutex);
drm_object_release(filp);
if (file_priv->remove_auth_on_close == 1) {