Skip to content

Commit

Permalink
drm: Remove two leaks of vblank reference count in error paths.
Browse files Browse the repository at this point in the history
If the failing paths were hit, the vblank IRQ would never get turned off
again.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Eric Anholt authored and Dave Airlie committed Oct 23, 2008
1 parent 786225e commit 35ad68c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,14 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
goto done;
}

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

atomic_inc(&dev->vbl_signal_pending);
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/i915_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
vbl_swap->plane == plane &&
vbl_swap->sequence == swap->sequence) {
spin_unlock_irqrestore(&dev_priv->swaps_lock, irqflags);
drm_vblank_put(dev, pipe);
DRM_DEBUG("Already scheduled\n");
return 0;
}
Expand Down

0 comments on commit 35ad68c

Please sign in to comment.