From 34a3bfeb17aca969b99eea56829f4aac30adba5a Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 27 Mar 2024 04:48:35 +0000 Subject: [PATCH] drm/amd/display: fix NULL checks for adev->dm.dc in amdgpu_dm_fini() From Nikita Zhandarovich e040f1fbe9abae91b12b074cfc3bbb5367b79811 in linux-6.6.y/6.6.23 2a3cfb9a24a28da9cc13d2c525a76548865e182c in mainline linux --- .../pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c index d747b582f5f..055ae7210f5 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1906,17 +1906,15 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) adev->dm.hdcp_workqueue = NULL; } - if (adev->dm.dc) + if (adev->dm.dc) { dc_deinit_callbacks(adev->dm.dc); - - if (adev->dm.dc) dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv); - - if (dc_enable_dmub_notifications(adev->dm.dc)) { - kfree(adev->dm.dmub_notify); - adev->dm.dmub_notify = NULL; - destroy_workqueue(adev->dm.delayed_hpd_wq); - adev->dm.delayed_hpd_wq = NULL; + if (dc_enable_dmub_notifications(adev->dm.dc)) { + kfree(adev->dm.dmub_notify); + adev->dm.dmub_notify = NULL; + destroy_workqueue(adev->dm.delayed_hpd_wq); + adev->dm.delayed_hpd_wq = NULL; + } } if (adev->dm.dmub_bo) -- 2.20.1