[PATCH 2/5] drm/amd/display: Fix null pointer derference in amdgpu_dm_fini()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some error cleaning paths call amdgpu_dm_fini() but may not have
initialized `adev->dm.delayed_hpd_wq`. Catch this and avoid
destroying the workqueue.

Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 94f1651422da1..5fd3d36964369 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2219,8 +2219,10 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
 		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.delayed_hpd_wq) {
+				destroy_workqueue(adev->dm.delayed_hpd_wq);
+				adev->dm.delayed_hpd_wq = NULL;
+			}
 		}
 	}
 
-- 
2.43.0




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux