aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
diff options
context:
space:
mode:
authorMario Limonciello <[email protected]>2025-07-15 19:41:46 +0000
committerAlex Deucher <[email protected]>2025-07-28 20:28:34 +0000
commitb174084b3fe15ad1acc69530e673c1535d2e4f85 (patch)
tree58d5d890277bb133b228cb565ce43a5d4db3b752 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
parentdrm/amd/display: Avoid configuring PSR granularity if PSR-SU not supported (diff)
downloadkernel-b174084b3fe15ad1acc69530e673c1535d2e4f85.tar.gz
kernel-b174084b3fe15ad1acc69530e673c1535d2e4f85.zip
drm/amd/display: Only finalize atomic_obj if it was initialized
[Why] If amdgpu_dm failed to initalize before amdgpu_dm_initialize_drm_device() completed then freeing atomic_obj will lead to list corruption. [How] Check if atomic_obj state is initialized before trying to free. Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Ivan Lipski <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 468c9c5a6773..5db0df2b0ecb 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5410,7 +5410,8 @@ fail:
static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm)
{
- drm_atomic_private_obj_fini(&dm->atomic_obj);
+ if (dm->atomic_obj.state)
+ drm_atomic_private_obj_fini(&dm->atomic_obj);
}
/******************************************************************************