drm/amdgpu: invoke pm_genpd_remove() before freeing genpd

Call pm_genpd_remove() to unregister from global list prior to releasing
acp_genpd memory, and clear the pointer after free.

Signed-off-by: Ce Sun <cesun102@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Ce Sun
2026-06-22 22:58:16 +08:00
committed by Alex Deucher
parent 98073e4328
commit cd8650d7a9

View File

@@ -560,7 +560,9 @@ static int acp_hw_fini(struct amdgpu_ip_block *ip_block)
mfd_remove_devices(adev->acp.parent);
kfree(adev->acp.i2s_pdata);
kfree(adev->acp.acp_res);
pm_genpd_remove(&adev->acp.acp_genpd->gpd);
kfree(adev->acp.acp_genpd);
adev->acp.acp_genpd = NULL;
kfree(adev->acp.acp_cell);
return ret;