Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35ad68c1 authored by Eric Anholt's avatar Eric Anholt Committed by Dave Airlie
Browse files

drm: Remove two leaks of vblank reference count in error paths.



If the failing paths were hit, the vblank IRQ would never get turned off
again.

Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Acked-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 786225eb
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -594,11 +594,14 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
			goto done;
			goto done;
		}
		}


		/* Get a refcount on the vblank, which will be released by
		 * drm_vbl_send_signals().
		 */
		ret = drm_vblank_get(dev, crtc);
		ret = drm_vblank_get(dev, crtc);
		if (ret) {
		if (ret) {
			drm_free(vbl_sig, sizeof(struct drm_vbl_sig),
			drm_free(vbl_sig, sizeof(struct drm_vbl_sig),
				 DRM_MEM_DRIVER);
				 DRM_MEM_DRIVER);
			return ret;
			goto done;
		}
		}


		atomic_inc(&dev->vbl_signal_pending);
		atomic_inc(&dev->vbl_signal_pending);
+1 −0
Original line number Original line Diff line number Diff line
@@ -771,6 +771,7 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
		    vbl_swap->plane == plane &&
		    vbl_swap->plane == plane &&
		    vbl_swap->sequence == swap->sequence) {
		    vbl_swap->sequence == swap->sequence) {
			spin_unlock_irqrestore(&dev_priv->swaps_lock, irqflags);
			spin_unlock_irqrestore(&dev_priv->swaps_lock, irqflags);
			drm_vblank_put(dev, pipe);
			DRM_DEBUG("Already scheduled\n");
			DRM_DEBUG("Already scheduled\n");
			return 0;
			return 0;
		}
		}