]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amd/display: Handle dml allocation failure to avoid crash
authorRyan Seto <ryanseto@amd.com>
Fri, 1 Nov 2024 14:19:56 +0000 (10:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 8 Nov 2024 16:45:30 +0000 (11:45 -0500)
commitbcafdc61529a48f6f06355d78eb41b3aeda5296c
treefa86131b5cc71c17160b076f714bcf6870bbe034
parente77a8005748547fb1f10645097f13ccdd804d7e5
drm/amd/display: Handle dml allocation failure to avoid crash

[Why]
In the case where a dml allocation fails for any reason, the
current state's dml contexts would no longer be valid. Then
subsequent calls dc_state_copy_internal would shallow copy
invalid memory and if the new state was released, a double
free would occur.

[How]
Reset dml pointers in new_state to NULL and avoid invalid
pointer

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Ryan Seto <ryanseto@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_state.c