drm/vmwgfx: Fix a buffer object leak
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 26 Apr 2018 07:59:30 +0000 (09:59 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 26 Apr 2018 07:59:30 +0000 (09:59 +0200)
A buffer object leak was introduced when fixing a premature buffer
object release. Fix this.

Cc: <stable@vger.kernel.org>
Fixes: 73a88250b709 ("Fix a destoy-while-held mutex problem.")
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index aacc9307ab0bb59adaa0e1f0be884ff14d4996aa..96fd7a03d2f8beac5301040adb64274422ca037b 100644 (file)
@@ -2595,6 +2595,7 @@ void vmw_kms_helper_resource_finish(struct vmw_validation_ctx *ctx,
                vmw_kms_helper_buffer_finish(res->dev_priv, NULL, ctx->buf,
                                             out_fence, NULL);
 
+       vmw_dmabuf_unreference(&ctx->buf);
        vmw_resource_unreserve(res, false, NULL, 0);
        mutex_unlock(&res->dev_priv->cmdbuf_mutex);
 }