3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilija Hadzic <ilijahad...@gmail.com>

commit 0f1cb1bd94a9c967cd4ad3de51cfdabe61eb5dcc upstream.

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 <ihad...@research.bell-labs.com>
Reviewed-by: Thomas Hellstrom <thellst...@vmware.com>
Signed-off-by: Dave Airlie <airl...@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/gpu/drm/drm_fops.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to