From ae98e25d198e9b10195ba6ca9237a689e48134d8 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 12 May 2023 11:21:13 +0000 Subject: [PATCH] drm/amd/display: Fix potential null dereference From Igor Artemiev b75aaebac265e3f29863699d9a929fdfba13d0a4 in linux-6.1.y/6.1.28 52f1783ff4146344342422c1cd94fcb4ce39b6fe in mainline linux --- sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 83013ee796e..0345a52e5b5 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 @@ -1765,7 +1765,8 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) dc_deinit_callbacks(adev->dm.dc); #endif - dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv); + 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); -- 2.20.1