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

Commit aef6a7ee authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Dave Airlie
Browse files

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: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d6b83952
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3335,11 +3335,13 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,

	ret = crtc->funcs->page_flip(crtc, fb, e);
	if (ret) {
		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:
	mutex_unlock(&dev->mode_config.mutex);