[AMD Official Use Only - General]

Reviewed-by: Roman Li <[email protected]>

> -----Original Message-----
> From: amd-gfx <[email protected]> On Behalf Of
> Srinivasan Shanmugam
> Sent: Friday, February 9, 2024 9:53 AM
> To: Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo
> <[email protected]>
> Cc: [email protected]; SHANMUGAM, SRINIVASAN
> <[email protected]>; Lakha, Bhawanpreet
> <[email protected]>; Wentland, Harry
> <[email protected]>
> 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 <[email protected]>
> Cc: Harry Wentland <[email protected]>
> Cc: Rodrigo Siqueira <[email protected]>
> Cc: Aurabindo Pillai <[email protected]>
> Signed-off-by: Srinivasan Shanmugam <[email protected]>
> ---
>  .../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

Reply via email to