Commit fc350ec8 authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Jiri Slaby

drm/vmwgfx: Fix fence event code

commit 89669e7a upstream.

The commit "vmwgfx: Rework fence event action" introduced a number of bugs
that are fixed with this commit:

a) A forgotten return stateemnt.
b) An if statement with identical branches.
Reported-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: default avatarJakob Bornecrantz <jakob@vmware.com>
Reviewed-by: default avatarSinclair Yeh <syeh@vmware.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent b743bb06
...@@ -1049,6 +1049,8 @@ int vmw_event_fence_action_create(struct drm_file *file_priv, ...@@ -1049,6 +1049,8 @@ int vmw_event_fence_action_create(struct drm_file *file_priv,
if (ret != 0) if (ret != 0)
goto out_no_queue; goto out_no_queue;
return 0;
out_no_queue: out_no_queue:
event->base.destroy(&event->base); event->base.destroy(&event->base);
out_no_event: out_no_event:
...@@ -1123,17 +1125,10 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data, ...@@ -1123,17 +1125,10 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
BUG_ON(fence == NULL); BUG_ON(fence == NULL);
if (arg->flags & DRM_VMW_FE_FLAG_REQ_TIME) ret = vmw_event_fence_action_create(file_priv, fence,
ret = vmw_event_fence_action_create(file_priv, fence, arg->flags,
arg->flags, arg->user_data,
arg->user_data, true);
true);
else
ret = vmw_event_fence_action_create(file_priv, fence,
arg->flags,
arg->user_data,
true);
if (unlikely(ret != 0)) { if (unlikely(ret != 0)) {
if (ret != -ERESTARTSYS) if (ret != -ERESTARTSYS)
DRM_ERROR("Failed to attach event to fence.\n"); DRM_ERROR("Failed to attach event to fence.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment