From 762e89c63a388387077d8526da941c1b13df9036 Mon Sep 17 00:00:00 2001 From: Wenjing Liu Date: Tue, 4 Aug 2026 14:01:54 -0400 Subject: [PATCH] drm/amd/display: Guard against empty DCN6 UTM QoS table [Why] The UTM QoS model population indexed into a firmware-provided table without checking whether it reported any load levels or SOPs, leaving a malformed table treated as valid instead of absent. [How] Bail out early and clear the output model pointer when the load level count or SOP count is zero. Reviewed-by: Alvin Lee Signed-off-by: Wenjing Liu Signed-off-by: James Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c index 267e5060c6b1..e927b9e810a3 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c @@ -625,6 +625,11 @@ static void dcn60_populate_utm_qos_model( const SocUtmTable_t *utm_table = &init_table->UtmTable; unsigned int ll, sop; + if (utm_table->Header.LoadLevelCount == 0 || utm_table->Header.SopCount == 0) { + *qos_model = NULL; + return; + } + memset(dchub, 0, sizeof(*dchub)); dchub->load_level_count = (uint8_t)utm_table->Header.LoadLevelCount; dchub->sop_count = (uint8_t)utm_table->Header.SopCount;