Skip to content

Commit 5182e44

Browse files
ISCAS-Vulabgregkh
authored andcommitted
drm/amd/display: set new_stream to NULL after release
commit 9fa26b9 upstream. In dm_update_crtc_state(), the skip_modeset path releases new_stream via dc_stream_release() but does not set the pointer to NULL. If a later error (e.g., color management failure) triggers the fail label, the error path calls dc_stream_release() again on the same dangling pointer, causing a double release and potential use-after-free. Fix this by setting new_stream to NULL after the initial release. Fixes: 9b690ef ("drm/amd/display: Avoid full modeset when not required") Signed-off-by: WenTao Liang <vulab@iscas.ac.cn> Reviewed-by: George Zhang <george.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 99f3af1) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e17a682 commit 5182e44

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10836,6 +10836,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
1083610836
/* Release extra reference */
1083710837
if (new_stream)
1083810838
dc_stream_release(new_stream);
10839+
new_stream = NULL;
1083910840

1084010841
/*
1084110842
* We want to do dc stream updates that do not require a

0 commit comments

Comments
 (0)