Unverified Commit 0ef53bb1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents c6ae314e 5e3a28cc
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -279,10 +279,18 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
		drm_gem_object_release(obj);
		return ret;
	}
	drm_gem_object_put(obj);

	rc->res_handle = qobj->hw_res_handle; /* similiar to a VM address */
	rc->bo_handle = handle;

	/*
	 * 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(obj);

	return 0;
}