drm/amdkfd: Cleanup vm process info if init vm failed
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 20 Dec 2022 19:55:03 +0000 (14:55 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 Jan 2023 21:40:45 +0000 (16:40 -0500)
commit23b02b0e4678d9d30931eecd5e5dbb06db7f957f
tree4833f274f6284f0e7b3161f59eba958a24581917
parent7f347e3f821743a02c249abe50e467a333fabcfe
drm/amdkfd: Cleanup vm process info if init vm failed

If acquire_vm failed when initializing KFD vm, set vm->process_info to
NULL and free process info, otherwise, the future acquire_vm will
always fail as vm->process_info is not NULL.

Pass avm as parameter to remove the duplicate code.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdkfd/kfd_process.c