Skip to content

Commit b174084

Browse files
superm1alexdeucher
authored andcommitted
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 <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>
1 parent a5ce869 commit b174084

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5410,7 +5410,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
54105410

54115411
static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm)
54125412
{
5413-
drm_atomic_private_obj_fini(&dm->atomic_obj);
5413+
if (dm->atomic_obj.state)
5414+
drm_atomic_private_obj_fini(&dm->atomic_obj);
54145415
}
54155416

54165417
/******************************************************************************

0 commit comments

Comments
 (0)