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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu/userq: clean the VA mapping list for failed queue creation

If the queue creation failed during mapping of the important VA's
like queue_va, rptr_va and wptr_va. These needs to be cleaned
as queue destroy will not be called for such queues as user never
get call to creation failure.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sunil Khatri and committed by
Alex Deucher
dc87834e a7fe8c1b

+5 -4
+5 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
··· 767 767 amdgpu_userq_input_va_validate(adev, queue, args->in.rptr_va, AMDGPU_GPU_PAGE_SIZE) || 768 768 amdgpu_userq_input_va_validate(adev, queue, args->in.wptr_va, AMDGPU_GPU_PAGE_SIZE)) { 769 769 r = -EINVAL; 770 - goto free_queue; 770 + goto clean_mapping; 771 771 } 772 772 773 773 /* Convert relative doorbell offset into absolute doorbell index */ ··· 775 775 if (index == (uint64_t)-EINVAL) { 776 776 drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n"); 777 777 r = -EINVAL; 778 - goto free_queue; 778 + goto clean_mapping; 779 779 } 780 780 781 781 queue->doorbell_index = index; ··· 783 783 r = amdgpu_userq_fence_driver_alloc(adev, &queue->fence_drv); 784 784 if (r) { 785 785 drm_file_err(uq_mgr->file, "Failed to alloc fence driver\n"); 786 - goto free_queue; 786 + goto clean_mapping; 787 787 } 788 788 789 789 /* ··· 857 857 clean_fence_driver: 858 858 amdgpu_userq_fence_driver_free(queue); 859 859 mutex_unlock(&uq_mgr->userq_mutex); 860 - free_queue: 860 + clean_mapping: 861 + amdgpu_userq_buffer_vas_list_cleanup(adev, queue); 861 862 kfree(queue); 862 863 return r; 863 864 }