Skip to content

Commit

Permalink
drm: fix page_flip error handling
Browse files Browse the repository at this point in the history
Free event and restore event_space only when page_flip->flags has
DRM_MODE_PAGE_FLIP_EVENT if page_flip() is failed.

Signed-off-by: Joonyoung Shim <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
Joonyoung Shim authored and airlied committed Apr 19, 2012
1 parent d6b8395 commit aef6a7e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,

ret = crtc->funcs->page_flip(crtc, fb, e);
if (ret) {
spin_lock_irqsave(&dev->event_lock, flags);
file_priv->event_space += sizeof e->event;
spin_unlock_irqrestore(&dev->event_lock, flags);
kfree(e);
if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
spin_lock_irqsave(&dev->event_lock, flags);
file_priv->event_space += sizeof e->event;
spin_unlock_irqrestore(&dev->event_lock, flags);
kfree(e);
}
}

out:
Expand Down

0 comments on commit aef6a7e

Please sign in to comment.