This is a note to let you know that I've just added the patch titled drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay() to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-amd-display-fix-variable-deferencing-before-null-check-in-edp_setup_replay.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7073934f5d73f8b53308963cee36f0d389ea857c Mon Sep 17 00:00:00 2001 From: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx> Date: Mon, 8 Jan 2024 21:20:28 +0530 Subject: drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay() From: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx> commit 7073934f5d73f8b53308963cee36f0d389ea857c upstream. In edp_setup_replay(), 'struct dc *dc' & 'struct dmub_replay *replay' was dereferenced before the pointer 'link' & 'replay' NULL check. Fixes the below: drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c:947 edp_setup_replay() warn: variable dereferenced before check 'link' (see line 933) Cc: stable@xxxxxxxxxxxxxxx Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@xxxxxxx> Cc: Harry Wentland <harry.wentland@xxxxxxx> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx> Cc: Aurabindo Pillai <aurabindo.pillai@xxxxxxx> Cc: Alex Deucher <alexander.deucher@xxxxxxx> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx> Reviewed-by: Aurabindo Pillai <aurabindo.pillai@xxxxxxx> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c | 11 ++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c @@ -920,8 +920,8 @@ bool edp_get_replay_state(const struct d bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream) { /* To-do: Setup Replay */ - struct dc *dc = link->ctx->dc; - struct dmub_replay *replay = dc->res_pool->replay; + struct dc *dc; + struct dmub_replay *replay; int i; unsigned int panel_inst; struct replay_context replay_context = { 0 }; @@ -937,6 +937,10 @@ bool edp_setup_replay(struct dc_link *li if (!link) return false; + dc = link->ctx->dc; + + replay = dc->res_pool->replay; + if (!replay) return false; @@ -965,8 +969,7 @@ bool edp_setup_replay(struct dc_link *li replay_context.line_time_in_ns = lineTimeInNs; - if (replay) - link->replay_settings.replay_feature_enabled = + link->replay_settings.replay_feature_enabled = replay->funcs->replay_copy_settings(replay, link, &replay_context, panel_inst); if (link->replay_settings.replay_feature_enabled) { Patches currently in stable-queue which might be from srinivasan.shanmugam@xxxxxxx are queue-6.6/drm-amd-display-fix-late-derefrence-dsc-check-in-link_set_dsc_pps_packet.patch queue-6.6/drm-amd-display-fix-variable-deferencing-before-null-check-in-edp_setup_replay.patch queue-6.6/drm-amd-display-fix-uninitialized-variable-usage-in-core_link_-read_dpcd-write_dpcd-functions.patch