linux-stable/drivers/gpu/drm/amd/display/dc/link
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
..
accessories drm/amd/display: Update FIXED_VS Retimer HWSS Test Pattern Sequences 2024-02-14 17:13:03 -05:00
hwss drm/amd/display: Update FIXED_VS Retimer HWSS Test Pattern Sequences 2024-02-14 17:13:03 -05:00
protocols drm/amd/display: Add 'replay' NULL check in 'edp_set_replay_allow_active()' 2024-02-16 15:43:51 -05:00
link_detection.c drm/amd/display: Add usb4_bw_alloc_support flag 2024-01-22 17:13:27 -05:00
link_detection.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
link_dpms.c drm/amd/display: Add usb4_bw_alloc_support flag 2024-01-22 17:13:27 -05:00
link_dpms.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
link_factory.c drm/amd/display: Add some functions for Panel Replay 2024-01-03 11:16:05 -05:00
link_factory.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
link_hwss_hpo_frl.c drm/amd/display: extract set stream attribute to link_hwss 2022-04-05 10:29:48 -04:00
link_resource.c drm/amd/display: move public dc link function implementation to dc_link_exports 2023-02-14 16:06:28 -05:00
link_resource.h drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
link_validation.c drm/amd/display: fixed integer types and null check locations 2024-02-14 17:13:28 -05:00
link_validation.h drm/amd/display: Add HDMI capacity computations using fixed31_32 2024-01-03 10:31:30 -05:00
Makefile drm/amd/display: Drop unused link FPGA code 2023-09-26 16:54:37 -04:00