]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:37:15 +0000 (08:37 +0200)
commitcacc0506e57158ac5ec0805274da9e8075452c89
tree04baaa2d21af5b2b026ebdda8cdff0ffa5a45833
parent9e3858f82e3ced1e990ef7116c3a16c84e62093e
drm/amdkfd: Fix potential deallocation of previously deallocated memory.

[ Upstream commit cabbdea1f1861098991768d7bbf5a49ed1608213 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c