diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2014-12-02 06:36:57 -0500 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2014-12-03 03:48:14 -0500 |
commit | 89669e7a7f96be3ee8d9a22a071d7c0d3b4428fc (patch) | |
tree | 8e49f79ff3cdc811c3f5fc93a646d19596023cb0 | |
parent | 1f563a6a46544602183e7493b6ef69769d3d76d9 (diff) |
drm/vmwgfx: Fix fence event code
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.
Cc: <stable@vger.kernel.org>
Reported-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c index 6773938b6e40..b7594cb758af 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | |||
@@ -1087,6 +1087,8 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv, | |||
1087 | if (ret != 0) | 1087 | if (ret != 0) |
1088 | goto out_no_queue; | 1088 | goto out_no_queue; |
1089 | 1089 | ||
1090 | return 0; | ||
1091 | |||
1090 | out_no_queue: | 1092 | out_no_queue: |
1091 | event->base.destroy(&event->base); | 1093 | event->base.destroy(&event->base); |
1092 | out_no_event: | 1094 | out_no_event: |
@@ -1162,17 +1164,10 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data, | |||
1162 | 1164 | ||
1163 | BUG_ON(fence == NULL); | 1165 | BUG_ON(fence == NULL); |
1164 | 1166 | ||
1165 | if (arg->flags & DRM_VMW_FE_FLAG_REQ_TIME) | 1167 | ret = vmw_event_fence_action_create(file_priv, fence, |
1166 | ret = vmw_event_fence_action_create(file_priv, fence, | 1168 | arg->flags, |
1167 | arg->flags, | 1169 | arg->user_data, |
1168 | arg->user_data, | 1170 | true); |
1169 | true); | ||
1170 | else | ||
1171 | ret = vmw_event_fence_action_create(file_priv, fence, | ||
1172 | arg->flags, | ||
1173 | arg->user_data, | ||
1174 | true); | ||
1175 | |||
1176 | if (unlikely(ret != 0)) { | 1171 | if (unlikely(ret != 0)) { |
1177 | if (ret != -ERESTARTSYS) | 1172 | if (ret != -ERESTARTSYS) |
1178 | DRM_ERROR("Failed to attach event to fence.\n"); | 1173 | DRM_ERROR("Failed to attach event to fence.\n"); |