diff options
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 7ef1b673e1be..af68eca44abe 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -135,8 +135,11 @@ int drm_open(struct inode *inode, struct file *filp) | |||
135 | retcode = drm_open_helper(inode, filp, dev); | 135 | retcode = drm_open_helper(inode, filp, dev); |
136 | if (!retcode) { | 136 | if (!retcode) { |
137 | atomic_inc(&dev->counts[_DRM_STAT_OPENS]); | 137 | atomic_inc(&dev->counts[_DRM_STAT_OPENS]); |
138 | if (!dev->open_count++) | 138 | if (!dev->open_count++) { |
139 | retcode = drm_setup(dev); | 139 | retcode = drm_setup(dev); |
140 | if (retcode) | ||
141 | dev->open_count--; | ||
142 | } | ||
140 | } | 143 | } |
141 | if (!retcode) { | 144 | if (!retcode) { |
142 | mutex_lock(&dev->struct_mutex); | 145 | mutex_lock(&dev->struct_mutex); |