[AMD Official Use Only - General] Reviewed-by: Roman Li <roman.li@xxxxxxx> > -----Original Message----- > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of > Srinivasan Shanmugam > Sent: Friday, February 9, 2024 9:53 AM > To: Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Pillai, Aurabindo > <Aurabindo.Pillai@xxxxxxx> > Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; SHANMUGAM, SRINIVASAN > <SRINIVASAN.SHANMUGAM@xxxxxxx>; Lakha, Bhawanpreet > <Bhawanpreet.Lakha@xxxxxxx>; Wentland, Harry > <Harry.Wentland@xxxxxxx> > Subject: [PATCH] drm/amd/display: Fix && vs || in > 'edp_set_replay_allow_active()' > > 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@xxxxxxx> > Cc: Harry Wentland <harry.wentland@xxxxxxx> > Cc: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx> > Cc: Aurabindo Pillai <aurabindo.pillai@xxxxxxx> > Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx> > --- > .../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