summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWenTao Liang <vulab@iscas.ac.cn>2026-06-28 15:27:40 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-07-17 17:41:25 -0400
commit9fa26b9eed6195bf840f39ac183b9a6237548755 (patch)
tree2afd45e6027b05a5cde3a37ba7346a4bdc501aea /drivers
parentbad177fa75e607e396cd57daaaed881450d7a471 (diff)
downloadlinux-next-9fa26b9eed6195bf840f39ac183b9a6237548755.tar.gz
linux-next-9fa26b9eed6195bf840f39ac183b9a6237548755.zip
drm/amd/display: set new_stream to NULL after release
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: 9b690ef3c704 ("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 99f3af19073b3ddbfd96e789124cce12c4277b28) Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c1
1 files changed, 1 insertions, 0 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 6210a1ff7cc2..b1e6d735cf02 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -12101,6 +12101,7 @@ skip_modeset:
/* Release extra reference */
if (new_stream)
dc_stream_release(new_stream);
+ new_stream = NULL;
/*
* We want to do dc stream updates that do not require a