From: Greg Kroah-Hartman Date: Wed, 7 Nov 2012 08:46:35 +0000 (+0100) Subject: 3.4-stable patches X-Git-Tag: v3.0.52~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74332b5402534cda52607fc93de0a5a542200136;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: drm-restore-open_count-if-drm_setup-fails.patch --- 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 index 00000000000..a664b2e8faf --- /dev/null +++ b/queue-3.4/drm-restore-open_count-if-drm_setup-fails.patch @@ -0,0 +1,37 @@ +From 0f1cb1bd94a9c967cd4ad3de51cfdabe61eb5dcc Mon Sep 17 00:00:00 2001 +From: Ilija Hadzic +Date: Mon, 29 Oct 2012 17:35:00 +0000 +Subject: drm: restore open_count if drm_setup fails + +From: Ilija Hadzic + +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 +Reviewed-by: Thomas Hellstrom +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-3.4/series b/queue-3.4/series index 575952e2dc7..ea2a323f721 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -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