]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Nov 2012 08:45:25 +0000 (09:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Nov 2012 08:45:25 +0000 (09:45 +0100)
added patches:
drm-restore-open_count-if-drm_setup-fails.patch

queue-3.0/drm-restore-open_count-if-drm_setup-fails.patch [new file with mode: 0644]
queue-3.0/series

diff --git a/queue-3.0/drm-restore-open_count-if-drm_setup-fails.patch b/queue-3.0/drm-restore-open_count-if-drm_setup-fails.patch
new file mode 100644 (file)
index 0000000..6abf32c
--- /dev/null
@@ -0,0 +1,37 @@
+From 0f1cb1bd94a9c967cd4ad3de51cfdabe61eb5dcc Mon Sep 17 00:00:00 2001
+From: Ilija Hadzic <ilijahadzic@gmail.com>
+Date: Mon, 29 Oct 2012 17:35:00 +0000
+Subject: drm: restore open_count if drm_setup fails
+
+From: Ilija Hadzic <ilijahadzic@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 <ihadzic@research.bell-labs.com>
+Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@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);
index 93a84fc30b8fda50598da5339b414f29c175fc92..2eb8ffcd3f964d6b5bab232304171e4b4339985b 100644 (file)
@@ -13,3 +13,4 @@ nfsv4-nfs4_locku_done-must-release-the-sequence-id.patch
 nfsd-add-get_uint-for-u32-s.patch
 nfs-fix-bug-in-legacy-dns-resolver.patch
 nfs-fix-oopses-in-nfs_lookup_revalidate-and-nfs4_lookup_revalidate.patch
+drm-restore-open_count-if-drm_setup-fails.patch