drm/amd/display: fix NULL checks for adev->dm.dc in amdgpu_dm_fini()
authorjsg <jsg@openbsd.org>
Wed, 27 Mar 2024 04:48:35 +0000 (04:48 +0000)
committerjsg <jsg@openbsd.org>
Wed, 27 Mar 2024 04:48:35 +0000 (04:48 +0000)
From Nikita Zhandarovich
e040f1fbe9abae91b12b074cfc3bbb5367b79811 in linux-6.6.y/6.6.23
2a3cfb9a24a28da9cc13d2c525a76548865e182c in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index d747b58..055ae72 100644 (file)
@@ -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)