Unverified Commit 3c6f6934 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 58e48128 48030fc4
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -309,7 +309,6 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
		}
		return ret;
	}
	drm_gem_object_put_unlocked(obj);

	rc->res_handle = res_id; /* similiar to a VM address */
	rc->bo_handle = handle;
@@ -318,6 +317,15 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
		virtio_gpu_unref_list(&validate_list);
		dma_fence_put(&fence->f);
	}

	/*
	 * The handle owns the reference now.  But we must drop our
	 * remaining reference *after* we no longer need to dereference
	 * the obj.  Otherwise userspace could guess the handle and
	 * race closing it from another thread.
	 */
	drm_gem_object_put_unlocked(obj);

	return 0;
fail_unref:
	if (vgdev->has_virgl_3d) {