From 4c32d2dd62b14244ac8135ebc408d538eff82d40 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 11 Oct 2024 02:25:18 +0000 Subject: [PATCH] drm/amd/display: Check link_res->hpo_dp_link_enc before using it From Alex Hung be2ca7a2c1561390d28bf2f92654d819659ba510 in linux-6.6.y/6.6.55 0beca868cde8742240cd0038141c30482d2b7eb8 in mainline linux --- .../pci/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/pci/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c b/sys/dev/pci/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c index 5dd5bd609c9..d0b0553dbdd 100644 --- a/sys/dev/pci/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c +++ b/sys/dev/pci/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c @@ -28,6 +28,8 @@ #include "dccg.h" #include "clk_mgr.h" +#define DC_LOGGER link->ctx->logger + void set_hpo_dp_throttled_vcp_size(struct pipe_ctx *pipe_ctx, struct fixed31_32 throttled_vcp_size) { @@ -124,6 +126,11 @@ void disable_hpo_dp_link_output(struct dc_link *link, const struct link_resource *link_res, enum amd_signal_type signal) { + if (!link_res->hpo_dp_link_enc) { + DC_LOG_ERROR("%s: invalid hpo_dp_link_enc\n", __func__); + return; + } + link_res->hpo_dp_link_enc->funcs->link_disable(link_res->hpo_dp_link_enc); link_res->hpo_dp_link_enc->funcs->disable_link_phy( link_res->hpo_dp_link_enc, signal); -- 2.20.1