From: Sung Joon Kim Date: Wed, 9 Aug 2023 20:39:53 +0000 (-0400) Subject: drm/amd/display: Add pointer check before function call X-Git-Tag: v6.7-rc1~145^2~10^2~305 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d44443305599d2e92b6696a8ca42e0dbaab8cb4d;p=thirdparty%2Fkernel%2Flinux.git drm/amd/display: Add pointer check before function call Call to immediate_disable_crtc was not checked before calling, exposing a potential null pointer hang. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c index 98d6a1f8af60d..ca6ce13921a72 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c @@ -128,7 +128,9 @@ static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state * if (stream_enc && stream_enc->funcs->disable_fifo) pipe->stream_res.stream_enc->funcs->disable_fifo(stream_enc); - pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg); + if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc) + pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg); + reset_sync_context_for_pipe(dc, context, i); } else { pipe->stream_res.tg->funcs->enable_crtc(pipe->stream_res.tg);