]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Only finalize atomic_obj if it was initialized
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 15 Jul 2025 19:41:46 +0000 (14:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:25 +0000 (16:28 +0200)
[ Upstream commit b174084b3fe15ad1acc69530e673c1535d2e4f85 ]

[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 <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index d4edddaa23dd3e07d9bbbe63cc4d2754d40bdbeb..10c607d84b43f56f88b5bbb0f99afaab54aa8b4c 100644 (file)
@@ -4620,7 +4620,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);
 }
 
 /******************************************************************************