linux/drivers/gpu/drm/amd/display/amdgpu_dm
Wentao Liang c5fd4eaad5 drm/amd/display: Fix dc stream excess put in dm_update_crtc_state()
In dm_update_crtc_state(), when a modeset is required the newly created
stream is stored in dm_new_crtc_state->stream and an extra reference is
taken with dc_stream_retain().  The reference returned by
create_validate_stream_for_sink() is released as an extra reference at
the skip_modeset label, leaving the stream owned by the new CRTC state.

If amdgpu_dm_check_crtc_color_mgmt() fails afterwards, the code jumps
to the fail label which releases new_stream again.  Since the extra
reference was already released at skip_modeset, this drops the
reference owned by dm_new_crtc_state->stream and the stream is
released while the atomic state still points to it, leading to a
premature free of the dc stream.

Set new_stream to NULL after releasing the extra reference at the
skip_modeset label so that a later goto fail cannot release the
reference owned by the new CRTC state.

Fixes: 7cd4b70091 ("drm/amd/display: Rework CRTC color management")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 102a47065a62dc8f6bbbb47cf082a2934282eb08)
Cc: stable@vger.kernel.org
2026-09-23 15:51:09 -04:00
..
tests drm/amd/display: Atomize IRQ register read/modify/write ops 2026-09-17 11:52:06 -04:00
amdgpu_dm_audio.c drm/amd/display: add KUnit tests for audio commit path 2026-07-28 19:17:30 -04:00
amdgpu_dm_audio.h drm/amd/display: Enable DCN6 sources compilation 2026-08-06 09:53:32 -04:00
amdgpu_dm_backlight.c drm/amd/display: Fix backlight control for luminance-capable OLED 2026-09-02 16:51:47 -04:00
amdgpu_dm_backlight.h drm/amd/display: Test panel power savings sysfs 2026-07-15 09:15:39 -04:00
amdgpu_dm_color.c drm/amd/display: validate plane degamma LUT size for private color prop 2026-08-19 10:14:55 -04:00
amdgpu_dm_color.h drm/amd/display: Add color transfer-function tests 2026-07-28 19:17:30 -04:00
amdgpu_dm_colorop.c drm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.h 2026-07-28 18:32:36 -04:00
amdgpu_dm_colorop.h drm/amd/display: Refactor amdgpu_dm_initialize_default_pipeline 2026-06-03 13:40:29 -04:00
amdgpu_dm_connector.c drm/amd/display: Honor Broadcast RGB for BT.2020 RGB output 2026-09-10 12:55:28 -04:00
amdgpu_dm_connector.h drm/amd/display: Refactor stream validation 2026-08-06 11:57:08 -04:00
amdgpu_dm_crc.c drm/amd/display: Configure all CRC engines in pipe CRC source path 2026-08-06 12:44:05 -04:00
amdgpu_dm_crc.h drm/amd/display: Extract DPRX CRC transition helpers for KUnit testing 2026-06-17 16:10:13 -04:00
amdgpu_dm_crtc.c drm/amd/display: Atomize IRQ register read/modify/write ops 2026-09-17 11:52:06 -04:00
amdgpu_dm_crtc.h drm/amd/display: Add active plane count tests for crtc 2026-08-06 09:58:58 -04:00
amdgpu_dm_cursor.c drm/amd/display: Set native cursor mode for disabled CRTCs again 2026-08-06 13:45:44 -04:00
amdgpu_dm_cursor.h drm/amd/display: add cursor module 2026-07-28 19:17:30 -04:00
amdgpu_dm_debugfs.c dm/amdgpu: fix malformed link_settings debugfs output 2026-09-10 12:52:59 -04:00
amdgpu_dm_debugfs.h drm/amd/display: Add missing SPDX license identifier 2025-07-28 16:40:30 -04:00
amdgpu_dm_dmub.c drm/amd/display: Enable DCN6 sources compilation 2026-08-06 09:53:32 -04:00
amdgpu_dm_dmub.h drm/amd/display: Enable DCN6 sources compilation 2026-08-06 09:53:32 -04:00
amdgpu_dm_freesync.c drm/amd/display: add FreeSync/VRR module 2026-07-28 19:17:30 -04:00
amdgpu_dm_freesync.h drm/amd/display: add FreeSync/VRR module 2026-07-28 19:17:30 -04:00
amdgpu_dm_hdcp.c drm/amd/display: Resize MST HDCP per-connector arrays to 32 2026-08-06 09:56:36 -04:00
amdgpu_dm_hdcp.h drm/amd/display: Resize MST HDCP per-connector arrays to 32 2026-08-06 09:56:36 -04:00
amdgpu_dm_helpers.c drm/amd/display: Atomize IRQ register read/modify/write ops 2026-09-17 11:52:06 -04:00
amdgpu_dm_helpers.h drm/amd/display: Test MST payload and DSC enable helpers 2026-07-15 09:15:37 -04:00
amdgpu_dm_irq_params.h drm/amd/display: Add CRC 32-bit mode support for DCN3.6+ 2026-02-03 16:43:12 -05:00
amdgpu_dm_irq.c drm/amd/display: Atomize IRQ register read/modify/write ops 2026-09-17 11:52:06 -04:00
amdgpu_dm_irq.h drm/amd/display: Atomize IRQ register read/modify/write ops 2026-09-17 11:52:06 -04:00
amdgpu_dm_ism.c drm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.h 2026-07-28 18:32:36 -04:00
amdgpu_dm_ism.h drm/amd/display: Extract dm_ism_dispatch_next_event 2026-06-03 13:41:44 -04:00
amdgpu_dm_mst_types.c drm/amd/display: Bounds-check connector->index in dm_dp_mst_get_modes 2026-08-06 09:58:08 -04:00
amdgpu_dm_mst_types.h drm/amd/display: Test MST coverage gaps 2026-07-15 09:15:39 -04:00
amdgpu_dm_plane.c drm/amd/display: advertise PIXEL_NONE and PREMULTI blend mode for DCE 2026-09-02 15:42:25 -03:00
amdgpu_dm_plane.h drm/amd/display: Don't use tiling flags anymore 2026-07-28 19:17:33 -04:00
amdgpu_dm_pp_smu.c drm/amd/display: move watermarks table to pp_smu 2026-07-28 19:17:29 -04:00
amdgpu_dm_pp_smu.h drm/amd/display: move watermarks table to pp_smu 2026-07-28 19:17:29 -04:00
amdgpu_dm_psr.c drm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.h 2026-07-28 18:32:36 -04:00
amdgpu_dm_psr.h drm/amd/display: Add KUnit tests for amdgpu_dm_psr 2026-07-01 11:37:10 -04:00
amdgpu_dm_quirks.c drm/amd/display: move stutter quirk to quirks file 2026-07-28 19:17:29 -04:00
amdgpu_dm_replay.c drm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.h 2026-07-28 18:32:36 -04:00
amdgpu_dm_replay.h drm/amd/display: Add power module on Linux 2026-04-17 15:41:16 -04:00
amdgpu_dm_services.c drm/amd/display: move GPU mem helpers to services 2026-07-28 19:17:30 -04:00
amdgpu_dm_trace.h drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
amdgpu_dm_wb.c drm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.h 2026-07-28 18:32:36 -04:00
amdgpu_dm_wb.h drm/amd/display: Add KUnit test for wb jobs 2026-07-15 09:15:39 -04:00
amdgpu_dm.c drm/amd/display: Fix dc stream excess put in dm_update_crtc_state() 2026-09-23 15:51:09 -04:00
amdgpu_dm.h drm/amd/display: Atomize IRQ register read/modify/write ops 2026-09-17 11:52:06 -04:00
dc_fpu.c drm/amd/display: Fix dc_is_fp_enabled name mismatch 2026-04-03 13:44:55 -04:00
dc_fpu.h drm/amd/display: make DC_RUN_WITH_PREEMPTION_ENABLED misuse a build error 2026-08-12 09:45:03 -04:00
Makefile drm/amd/display: add cursor module 2026-07-28 19:17:30 -04:00