Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: fix error handling in amdgpu_bo_list_create

We need to drop normal and userptr BOs separately.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
de51a501 3122051e

+6 -1
+6 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
··· 140 140 return 0; 141 141 142 142 error_free: 143 - while (i--) { 143 + for (i = 0; i < last_entry; ++i) { 144 + struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo); 145 + 146 + amdgpu_bo_unref(&bo); 147 + } 148 + for (i = first_userptr; i < num_entries; ++i) { 144 149 struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo); 145 150 146 151 amdgpu_bo_unref(&bo);