projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d70f8c
)
drm: restore open_count if drm_setup fails
author
Ilija Hadzic
<
[email protected]
>
Mon, 29 Oct 2012 17:35:00 +0000
(17:35 +0000)
committer
Dave Airlie
<
[email protected]
>
Wed, 7 Nov 2012 00:51:08 +0000
(10:51 +1000)
If drm_setup (called at first open) fails, the whole
open call has failed, so we should not keep the
open_count incremented.
Signed-off-by: Ilija Hadzic <
[email protected]
>
Cc:
[email protected]
Reviewed-by: Thomas Hellstrom <
[email protected]
>
Signed-off-by: Dave Airlie <
[email protected]
>
drivers/gpu/drm/drm_fops.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/drm_fops.c
b/drivers/gpu/drm/drm_fops.c
index 7ef1b673e1be9ec2f82006ca3d8ea2519e13b231..af68eca44abed7d46638a106d5f6b6cad79fe6e9 100644
(file)
--- 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)
retcode = drm_open_helper(inode, filp, dev);
if (!retcode) {
atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
- if (!dev->open_count++)
+ if (!dev->open_count++)
{
retcode = drm_setup(dev);
+ if (retcode)
+ dev->open_count--;
+ }
}
if (!retcode) {
mutex_lock(&dev->struct_mutex);