Commit de51a501 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: fix error handling in amdgpu_bo_list_create



We need to drop normal and userptr BOs separately.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3122051e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -140,7 +140,12 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp,
	return 0;

error_free:
	while (i--) {
	for (i = 0; i < last_entry; ++i) {
		struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo);

		amdgpu_bo_unref(&bo);
	}
	for (i = first_userptr; i < num_entries; ++i) {
		struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo);

		amdgpu_bo_unref(&bo);