X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fgpu%2Fdrm%2Fdrm_fops.c;h=79d5221c6e41c9880b5620623c9653799c1044ed;hb=9136ce889254ed51a00a41194befee8ecb2eda36;hp=4b060942cb3c4eed3f07f211d53d1e5f43f26f30;hpb=acf8294fecd4b805b408d02c321a0fd7eef95555;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 4b060942cb3c..79d5221c6e41 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -194,6 +194,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) goto out_close; } + priv->is_master = 1; /* take another reference for the copy in the local file priv */ priv->master = drm_master_get(priv->minor->master); priv->authenticated = 1; @@ -425,7 +426,7 @@ int drm_release(struct inode *inode, struct file *filp) mutex_lock(&dev->master_mutex); - if (drm_is_master(file_priv)) { + if (file_priv->is_master) { struct drm_master *master = file_priv->master; /** @@ -453,6 +454,7 @@ int drm_release(struct inode *inode, struct file *filp) /* drop the master reference held by the file priv */ if (file_priv->master) drm_master_put(&file_priv->master); + file_priv->is_master = 0; mutex_unlock(&dev->master_mutex); if (dev->driver->postclose)