[bug report] drm/vmwgfx: Use new validation interface for the modesetting code v2
Dan Carpenter
dan.carpenter at oracle.com
Thu Oct 11 12:19:05 UTC 2018
Hello Thomas Hellstrom,
The patch 2724b2d54cda: "drm/vmwgfx: Use new validation interface for
the modesetting code v2" from Sep 26, 2018, leads to the following
static checker warning:
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:2606 vmw_kms_helper_validation_finish()
error: uninitialized symbol 'handle'.
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
2587 void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv,
2588 struct drm_file *file_priv,
2589 struct vmw_validation_context *ctx,
2590 struct vmw_fence_obj **out_fence,
2591 struct drm_vmw_fence_rep __user *
2592 user_fence_rep)
2593 {
2594 struct vmw_fence_obj *fence = NULL;
2595 uint32_t handle;
2596 int ret;
2597
2598 if (file_priv || user_fence_rep || vmw_validation_has_bos(ctx) ||
2599 out_fence)
2600 ret = vmw_execbuf_fence_commands(file_priv, dev_priv, &fence,
2601 file_priv ? &handle : NULL);
2602 vmw_validation_done(ctx, fence);
2603 if (file_priv)
2604 vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv),
2605 ret, user_fence_rep, fence,
^^^
2606 handle, -1, NULL);
^^^^^^
So instead of handling vmw_execbuf_fence_commands() errors here, we pass
it to vmw_execbuf_copy_fence_user() which presumably does the right
thing. But the warning is correct that "handle" can be uninitialized
here.
2607 if (out_fence)
2608 *out_fence = fence;
2609 else
2610 vmw_fence_obj_unreference(&fence);
2611 }
regards,
dan carpenter
More information about the dri-devel
mailing list