]> www.infradead.org Git - nvme.git/commitdiff
drm/amd/display: Add pointer check before function call
authorSung Joon Kim <sungkim@amd.com>
Wed, 9 Aug 2023 20:39:53 +0000 (16:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Sep 2023 20:24:08 +0000 (16:24 -0400)
Call to immediate_disable_crtc was not checked before calling, exposing
a potential null pointer hang.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Sung Joon Kim <sungkim@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c

index 98d6a1f8af60df212b775ce918b0fca75a9b2812..ca6ce13921a72bd9fd16056b83cfc0b6833857df 100644 (file)
@@ -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);