From 6c1cd97bdaffa2ae1dbdc8a0857931308ac647cd Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 19 Oct 2018 08:18:47 +0200 Subject: drm/virtio: fix resource id handling Move virtio_gpu_resource_id_{get,put} to virtgpu_object.c and make them static. Allocate and free the id on creation and destroy, drop all other calls. That way objects have a valid handle for the whole lifetime of the object. Also fixes ids leaking. Worst offender are dumb buffers, and I think some error paths too. Signed-off-by: Gerd Hoffmann Reviewed-by: Dave Airlie Link: http://patchwork.freedesktop.org/patch/msgid/20181019061847.18958-7-kraxel@redhat.com --- drivers/gpu/drm/virtio/virtgpu_gem.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/gpu/drm/virtio/virtgpu_gem.c') diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 665d18a49d42..f06586393974 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -103,7 +103,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB8888); obj = gem_to_virtio_gpu_obj(gobj); - virtio_gpu_resource_id_get(vgdev, &obj->hw_res_handle); virtio_gpu_cmd_create_resource(vgdev, obj, format, args->width, args->height); -- cgit v1.2.3