Fixes: 900a80f9e4f ("virgl: virgl_transfer should own its virgl_resource")
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
if (!ptr)
goto fail;
+ /* trans->resolve_transfer owns resolve_tmp now */
+ pipe_resource_reference(&resolve_tmp, NULL);
+
*transfer = &trans->base;
if (fmt == resource->format) {
trans->base.stride = trans->resolve_transfer->stride;
}
if (trans->resolve_transfer) {
- pipe_resource_reference(&trans->resolve_transfer->resource, NULL);
virgl_resource_destroy_transfer(vctx,
virgl_transfer(trans->resolve_transfer));
}