From 13a991eac7a5bde942ed4475463c2021c26c5951 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 26 Jul 2023 06:33:09 +0000 Subject: [PATCH] drm/amd/display: add a NULL pointer check From Sung-huai Wang ad85fc99d6389bde08dc1dec55a2443514feba6e in linux-6.1.y/6.1.40 0f48a4b83610cb0e4e0bc487800ab69f51b4aca6 in mainline linux --- .../pci/drm/amd/display/dc/dce112/dce112_resource.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/drm/amd/display/dc/dce112/dce112_resource.c b/sys/dev/pci/drm/amd/display/dc/dce112/dce112_resource.c index e179e80667d..19d7cfa5321 100644 --- a/sys/dev/pci/drm/amd/display/dc/dce112/dce112_resource.c +++ b/sys/dev/pci/drm/amd/display/dc/dce112/dce112_resource.c @@ -970,10 +970,12 @@ enum dc_status resource_map_phy_clock_resources( || dc_is_virtual_signal(pipe_ctx->stream->signal)) pipe_ctx->clock_source = dc->res_pool->dp_clock_source; - else - pipe_ctx->clock_source = find_matching_pll( - &context->res_ctx, dc->res_pool, - stream); + else { + if (stream && stream->link && stream->link->link_enc) + pipe_ctx->clock_source = find_matching_pll( + &context->res_ctx, dc->res_pool, + stream); + } if (pipe_ctx->clock_source == NULL) return DC_NO_CLOCK_SOURCE_RESOURCE; -- 2.20.1