drm/amd/pm: fix a double-free in si_dpm_init
authorjsg <jsg@openbsd.org>
Mon, 29 Jan 2024 01:40:59 +0000 (01:40 +0000)
committerjsg <jsg@openbsd.org>
Mon, 29 Jan 2024 01:40:59 +0000 (01:40 +0000)
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

index 02e69cc..f81e4bd 100644 (file)
@@ -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;