• Zhipeng Lu's avatar
    drm/amd/pm: fix a double-free in si_dpm_init · ac166672
    Zhipeng Lu authored
    When the allocation of
    adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries fails,
    amdgpu_free_extended_power_table is called to free some fields of adev.
    However, when the control flow returns to si_dpm_sw_init, it goes to
    label dpm_failed and calls si_dpm_fini, which calls
    amdgpu_free_extended_power_table again and free those fields again. Thus
    a double-free is triggered.
    
    Fixes: 841686df ("drm/amdgpu: add SI DPM support (v4)")
    Signed-off-by: default avatarZhipeng Lu <alexious@zju.edu.cn>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    ac166672
si_dpm.c 254 KB