[PATCH] [v2] drm/lima: fix a memleak in lima_heap_alloc

2024-01-16 Thread Zhipeng Lu
When lima_vm_map_bo fails, the resources need to be deallocated, or there will be memleaks. Fixes: 6aebc51d7aef ("drm/lima: support heap buffer creation") Signed-off-by: Zhipeng Lu --- Changelog: v2: rearrange the error-handling to ladder tags. --- drivers/gpu/drm/lima/lima_

[PATCH] drm/lima: fix a memleak in lima_heap_alloc

2024-01-12 Thread Zhipeng Lu
When lima_vm_map_bo fails, the resources need to be deallocated, or there will be memleaks. Fixes: 6aebc51d7aef ("drm/lima: support heap buffer creation") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/lima/lima_gem.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) di

[PATCH] drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init

2023-12-24 Thread Zhipeng Lu
ng") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index 11372fcc59c8..b1

[PATCH] drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table

2023-12-14 Thread Zhipeng Lu
a new holder for those APIs used only by legacy ASICs(si/kv)") Signed-off-by: Zhipeng Lu --- .../gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c| 52 +-- 1 file changed, 13 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c b/drivers/gpu

[PATCH] gpu/drm/radeon: fix two memleaks in radeon_vm_init

2023-12-14 Thread Zhipeng Lu
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-b

[PATCH] drivers/amd/pm: fix a use-after-free in kv_parse_power_table

2023-12-14 Thread Zhipeng Lu
ni The adev->pm.dpm.ps is used in the for loop of kv_dpm_fini after its first free in kv_parse_power_table and causes a use-after-free bug. Fixes: a2e73f56fa62 ("drm/amdgpu: Add support for CIK parts") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 4 +--- 1

[PATCH] drm/amd/pm: fix a double-free in si_dpm_init

2023-12-14 Thread Zhipeng Lu
lls amdgpu_free_extended_power_table again and free those fields again. Thus a double-free is triggered. Fixes: 841686df9f7d ("drm/amdgpu: add SI DPM support (v4)") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --

[PATCH] [v2] drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table

2023-12-04 Thread Zhipeng Lu
dd dpm support for trinity asics") Signed-off-by: Zhipeng Lu --- Changelog: v2: Adding {} to correct the if statement. --- drivers/gpu/drm/radeon/trinity_dpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/

[PATCH] [v2] drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node

2023-12-04 Thread Zhipeng Lu
When ida_alloc_max fails, resources allocated before should be freed, including *res allocated by kmalloc and ttm_resource_init. Fixes: d3bcb4b02fe9 ("drm/vmwgfx: switch the TTM backends to self alloc") Signed-off-by: Zhipeng Lu --- Changelog: v2: Adding {} to correct the if

[PATCH] [v2] drm/radeon/dpm: fix a memleak in sumo_parse_power_table

2023-12-04 Thread Zhipeng Lu
dd dpm support for sumo asics (v2)") Signed-off-by: Zhipeng Lu --- Changelog: v2: Adding {} to make if statement correct. --- drivers/gpu/drm/radeon/sumo_dpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/rade

[PATCH] drm/radeon/dpm: fix a memleak in sumo_parse_power_table

2023-12-04 Thread Zhipeng Lu
dd dpm support for sumo asics (v2)") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/radeon/sumo_dpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c index f74f381af05f..bde640053708 100644 --- a/drivers/gpu/drm/rade

[PATCH] drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table

2023-12-04 Thread Zhipeng Lu
dd dpm support for trinity asics") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/radeon/trinity_dpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 08ea1c864cb2..8bf56fb7b933 100644 --- a/drivers/gpu/drm/r

[PATCH] drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node

2023-12-04 Thread Zhipeng Lu
When ida_alloc_max fails, resources allocated before should be freed, including *res allocated by kmalloc and ttm_resource_init. Fixes: d3bcb4b02fe9 ("drm/vmwgfx: switch the TTM backends to self alloc") Signed-off-by: Zhipeng Lu --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 2