gpu/drm/radeon: fix two memleaks in radeon_vm_init
authorZhipeng Lu <alexious@zju.edu.cn>
Thu, 14 Dec 2023 16:58:42 +0000 (00:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:36 +0000 (15:35 -0800)
commit4c9a96dd6d4acaa18146f5b1de457fec1004628c
tree6d6c132072b156abd5b62b7ee16c6d766d392a31
parent95084632a65d5c0d682a83b55935560bdcd2a1e3
gpu/drm/radeon: fix two memleaks in radeon_vm_init

[ Upstream commit c2709b2d6a537ca0fa0f1da36fdaf07e48ef447d ]

When radeon_bo_create and radeon_vm_clear_bo fail, the vm->page_tables
allocated before need to be freed. However, neither radeon_vm_init
itself nor its caller have done such deallocation.

Fixes: 6d2f2944e95e ("drm/radeon: use normal BOs for the page tables v4")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/radeon/radeon_vm.c