[PATCH] drm/amd/display: Fix && vs || in 'edp_set_replay_allow_active()'
Srinivasan Shanmugam
srinivasan.shanmugam at amd.com
Fri Feb 9 14:52:58 UTC 2024
AND should be OR or it will lead to a NULL dereference.
Fixes the below:
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: c7ddc0a800bc ("drm/amd/display: Add Functions to enable Freesync Panel Replay")
Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
Cc: Harry Wentland <harry.wentland at amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
---
.../drm/amd/display/dc/link/protocols/link_edp_panel_control.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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
index 443215b96308..77648228ec60 100644
--- 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
@@ -884,7 +884,7 @@ bool edp_set_replay_allow_active(struct dc_link *link, const bool *allow_active,
struct dmub_replay *replay = dc->res_pool->replay;
unsigned int panel_inst;
- if (replay == NULL && force_static)
+ if (!replay || force_static)
return false;
if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
--
2.34.1
More information about the amd-gfx
mailing list