From dac1dc01eec3fe840c68ab819921c74e6c480d7a Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 29 Jan 2024 01:40:59 +0000 Subject: [PATCH] drm/amd/pm: fix a double-free in si_dpm_init From Zhipeng Lu fb1936cb587262cd539e84b34541abb06e42b2f9 in linux-6.6.y/6.6.14 ac16667237a82e2597e329eb9bc520d1cf9dff30 in mainline linux --- sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c b/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c index 02e69ccff3b..f81e4bd4811 100644 --- a/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c +++ b/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c @@ -7379,10 +7379,9 @@ static int si_dpm_init(struct amdgpu_device *adev) kcalloc(4, sizeof(struct amdgpu_clock_voltage_dependency_entry), GFP_KERNEL); - if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) { - amdgpu_free_extended_power_table(adev); + if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) return -ENOMEM; - } + adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.count = 4; adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries[0].clk = 0; adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries[0].v = 0; -- 2.20.1