Skip to content

Commit c1d1711

Browse files
Zhu Lingshanaaron-ang
authored andcommitted
amdkfd: properly free gang_ctx_bo when failed to init user queue
The destructor of a gtt bo is declared as void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj); Which takes void** as the second parameter. GCC allows passing void* to the function because void* can be implicitly casted to any other types, so it can pass compiling. However, passing this void* parameter into the function's execution process(which expects void** and dereferencing void**) will result in errors. Signed-off-by: Zhu Lingshan <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Fixes: fb91065 ("drm/amdkfd: Refactor queue wptr_bo GART mapping") Signed-off-by: Alex Deucher <[email protected]>
1 parent 6338638 commit c1d1711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static int init_user_queue(struct process_queue_manager *pqm,
300300
return 0;
301301

302302
free_gang_ctx_bo:
303-
amdgpu_amdkfd_free_gtt_mem(dev->adev, (*q)->gang_ctx_bo);
303+
amdgpu_amdkfd_free_gtt_mem(dev->adev, &(*q)->gang_ctx_bo);
304304
cleanup:
305305
uninit_queue(*q);
306306
*q = NULL;

0 commit comments

Comments
 (0)