From: jsg Date: Fri, 11 Oct 2024 02:13:25 +0000 (+0000) Subject: drm/amd/display: Check null pointers before using dc->clk_mgr X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5c3d34bfcf8de972f5e7443c4134e9e071d16722;p=openbsd drm/amd/display: Check null pointers before using dc->clk_mgr From Alex Hung 9641bc4adf8446034e490ed543ae7e9833cfbdf5 in linux-6.6.y/6.6.55 95d9e0803e51d5a24276b7643b244c7477daf463 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c index 0b2eb2a6c8e..a7a6f6c5c76 100644 --- a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c +++ b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c @@ -4716,7 +4716,8 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow) 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; }