aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Hung <alex.hung@amd.com>2024-07-29 15:29:09 -0600
committerAlex Deucher <alexander.deucher@amd.com>2024-08-13 10:32:17 -0400
commit95d9e0803e51d5a24276b7643b244c7477daf463 (patch)
tree7bec6c4c73c34b32fb01a0bedae3ed7d99da284e
parentdrm/amd/display: 3DLUT non-DMA refactor (diff)
downloadlinux-95d9e0803e51d5a24276b7643b244c7477daf463.tar.gz
linux-95d9e0803e51d5a24276b7643b244c7477daf463.zip
drm/amd/display: Check null pointers before using dc->clk_mgr
[WHY & HOW] dc->clk_mgr is null checked previously in the same function, indicating it might be null. Passing "dc" to "dc->hwss.apply_idle_power_optimizations", which dereferences null "dc->clk_mgr". (The function pointer resolves to "dcn35_apply_idle_power_optimizations".) This fixes 1 FORWARD_NULL issue reported by Coverity. Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index b1253e4c81a8..3ba2acfdae2a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -5425,7 +5425,8 @@ void dc_allow_idle_optimizations_internal(struct dc *dc, bool allow, char const
if (allow == dc->idle_optimizations_allowed)
return;
- if (dc->hwss.apply_idle_power_optimizations && dc->hwss.apply_idle_power_optimizations(dc, allow))
+ if (dc->hwss.apply_idle_power_optimizations && dc->clk_mgr != NULL &&
+ dc->hwss.apply_idle_power_optimizations(dc, allow))
dc->idle_optimizations_allowed = allow;
}