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

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

diff --git a/queue-3.4/drm-restore-open_count-if-drm_setup-fails.patch b/queue-3.4/drm-restore-open_count-if-drm_setup-fails.patch
new file mode 100644 (file)
index 0000000..a664b2e
--- /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
+@@ -139,8 +139,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 575952e2dc7531016251ac1f60eb1de1bf05e143..ea2a323f721326297de8cb155e973e2d10afebf1 100644 (file)
@@ -26,3 +26,4 @@ nfsv4.1-we-must-release-the-sequence-id-when-we-fail-to-get-a-session-slot.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