linux/drivers/gpu/drm/amd/pm
Zhipeng Lu a658270117 drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table
The amdgpu_free_extended_power_table is called in every error-handling
paths of amdgpu_parse_extended_power_table. However, after the following
call chain of returning:

amdgpu_parse_extended_power_table
  |-> kv_dpm_init / si_dpm_init
      (the only two caller of amdgpu_parse_extended_power_table)
        |-> kv_dpm_sw_init / si_dpm_sw_init
            (the only caller of kv_dpm_init / si_dpm_init, accordingly)
              |-> kv_dpm_fini / si_dpm_fini
                  (goto dpm_failed in xx_dpm_sw_init)
                    |-> amdgpu_free_extended_power_table

As above, the amdgpu_free_extended_power_table is called twice in this
returning chain and thus a double-free is triggered. Similarily, the
last kfree in amdgpu_parse_extended_power_table also cause a double free
with amdgpu_free_extended_power_table in kv_dpm_fini.

Fixes: 84176663e7 ("drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv)")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-12-14 15:29:08 -05:00
..
inc drm/amd/pm: support return vpe clock table 2023-12-14 15:25:59 -05:00
legacy-dpm drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table 2023-12-14 15:29:08 -05:00
powerplay drm/amd/pm: Fix return value and drop redundant param 2023-11-17 09:29:53 -05:00
swsmu drm/amd/pm: Remove unneeded semicolon 2023-12-14 15:28:11 -05:00
amdgpu_dpm_internal.c drm/amd/pm: add missing prototypes to amdgpu_dpm_internal 2022-02-07 18:03:50 -05:00
amdgpu_dpm.c drm/amd/pm: support return vpe clock table 2023-12-14 15:25:59 -05:00
amdgpu_pm.c drm/amd/pm: fix pp_*clk_od typo 2023-12-07 17:39:19 -05:00
Makefile drm/amd/swsmu: add smu14 ip support 2023-10-13 10:59:55 -04:00