Commit b8be9e19 authored by Christian König's avatar Christian König
Browse files

drm/ttm: fix access to uninitialized variable.



The resource is not allocated yet, so no chance that this will work.

Use the placement instead.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210607171152.15914-1-christian.koenig@amd.com
parent 24994b91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -749,7 +749,7 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
	struct ww_acquire_ctx *ticket;
	int ret;

	man = ttm_manager_type(bdev, (*mem)->mem_type);
	man = ttm_manager_type(bdev, place->mem_type);
	ticket = dma_resv_locking_ctx(bo->base.resv);
	do {
		ret = ttm_resource_alloc(bo, place, mem);