mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
drm: fix page_flip error handling
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 <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
d6b8395262
commit
aef6a7eeac
1 changed files with 6 additions and 4 deletions
|
@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
|
||||||
|
|
||||||
ret = crtc->funcs->page_flip(crtc, fb, e);
|
ret = crtc->funcs->page_flip(crtc, fb, e);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
spin_lock_irqsave(&dev->event_lock, flags);
|
if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
|
||||||
file_priv->event_space += sizeof e->event;
|
spin_lock_irqsave(&dev->event_lock, flags);
|
||||||
spin_unlock_irqrestore(&dev->event_lock, flags);
|
file_priv->event_space += sizeof e->event;
|
||||||
kfree(e);
|
spin_unlock_irqrestore(&dev->event_lock, flags);
|
||||||
|
kfree(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in a new issue