linux-stable/drivers/gpu/drm/amd/display/dc/link/protocols
Srinivasan Shanmugam f6aed043ee drm/amd/display: Add 'replay' NULL check in 'edp_set_replay_allow_active()'
In the first if statement, we're checking if 'replay' is NULL. But in
the second if statement, we're not checking if 'replay' is NULL again
before calling replay->funcs->replay_set_power_opt().

if (replay == NULL && force_static)
    return false;

...

if (link->replay_settings.replay_feature_enabled &&
    replay->funcs->replay_set_power_opt) {
	replay->funcs->replay_set_power_opt(replay, *power_opts, panel_inst);
	link->replay_settings.replay_power_opt_active = *power_opts;
}

If 'replay' is NULL, this will cause a null pointer dereference.

Fixes the below found by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c:895 edp_set_replay_allow_active() error: we previously assumed 'replay' could be null (see line 887)

Fixes: c7ddc0a800 ("drm/amd/display: Add Functions to enable Freesync Panel Replay")
Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Suggested-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-02-16 15:43:51 -05:00
..
link_ddc.c drm/amd/display: switch DC over to the new DRM logging macros 2023-09-26 17:00:21 -04:00
link_ddc.h drm/amd/display: Support Compliance Test Pattern Generation with DP2 Retimer 2023-08-15 18:08:27 -04:00
link_dp_capability.c drm/amd/display: Wake DMCUB before sending a command 2023-12-19 14:59:02 -05:00
link_dp_capability.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
link_dp_dpia.c drm/amd/display: Dpia hpd status not in sync after S4 2024-01-09 15:43:54 -05:00
link_dp_dpia.h drm/amd/display: move dc_link functions in protocols folder to dc_link_exports 2023-03-07 14:22:40 -05:00
link_dp_dpia_bw.c drm/amd/display: Fix buffer overflow in 'get_host_router_total_dp_tunnel_bw()' 2024-01-31 14:05:19 -05:00
link_dp_dpia_bw.h drm/amd/display: Request usb4 bw for mst streams 2024-01-09 15:43:54 -05:00
link_dp_irq_handler.c drm/amd/display: Fix Replay Desync Error IRQ handler 2023-12-06 15:22:34 -05:00
link_dp_irq_handler.h drm/amd/display: move dc_link functions in protocols folder to dc_link_exports 2023-03-07 14:22:40 -05:00
link_dp_phy.c drm/amd/display: Update FIXED_VS Retimer HWSS Test Pattern Sequences 2024-02-14 17:13:03 -05:00
link_dp_phy.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
link_dp_training.c drm/amd/display: Add align done check 2024-02-14 17:08:51 -05:00
link_dp_training.h drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings() 2024-01-05 16:10:44 -05:00
link_dp_training_8b_10b.c drm/amd/display: Add logging when DP link training Channel EQ is Successful 2023-06-09 09:27:14 -04:00
link_dp_training_8b_10b.h
link_dp_training_128b_132b.c drm/amd/display: Add logging when DP link training Channel EQ is Successful 2023-06-09 09:27:14 -04:00
link_dp_training_128b_132b.h
link_dp_training_auxless.c drm/amd/display: move dc_link functions in protocols folder to dc_link_exports 2023-03-07 14:22:40 -05:00
link_dp_training_auxless.h drm/amd/display: move dc_link functions in protocols folder to dc_link_exports 2023-03-07 14:22:40 -05:00
link_dp_training_dpia.c drm/amd/display: Initialize 'wait_time_microsec' variable in link_dp_training_dpia.c 2024-02-12 16:12:10 -05:00
link_dp_training_dpia.h drm/amd/display: move dc_link functions in protocols folder to dc_link_exports 2023-03-07 14:22:40 -05:00
link_dp_training_fixed_vs_pe_retimer.c drm/amd/display: Don't perform rate toggle on DP2-capable FIXED_VS retimers 2024-02-07 12:26:21 -05:00
link_dp_training_fixed_vs_pe_retimer.h drm/amd/display: Remove Legacy FIXED_VS Transparent LT Sequence 2024-02-07 12:25:51 -05:00
link_dpcd.c drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions 2024-01-22 17:13:26 -05:00
link_dpcd.h
link_edp_panel_control.c drm/amd/display: Add 'replay' NULL check in 'edp_set_replay_allow_active()' 2024-02-16 15:43:51 -05:00
link_edp_panel_control.h drm/amd/display: Add some functions for Panel Replay 2024-01-03 11:16:05 -05:00
link_hpd.c drm/amd/display: move dc_link functions in protocols folder to dc_link_exports 2023-03-07 14:22:40 -05:00
link_hpd.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00