drm/amdkfd: Fix potential deallocation of previously deallocated memory.
authorDaniil Dulov <d.dulov@aladdin.ru>
Thu, 11 May 2023 11:23:14 +0000 (04:23 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:38:38 +0000 (09:38 -0400)
commitcabbdea1f1861098991768d7bbf5a49ed1608213
treed3cb0cd366ce0d193c99965625ed1c0afd40615b
parent6d99f3f4ea948f26b074a069c0406dd7f1cb0d8f
drm/amdkfd: Fix potential deallocation of previously deallocated memory.

Pointer mqd_mem_obj can be deallocated in kfd_gtt_sa_allocate().
The function then returns non-zero value, which causes the second deallocation.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: d1f8f0d17d40 ("drm/amdkfd: Move non-sdma mqd allocation out of init_mqd")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c