drm/amd/display: Fix potential null dereference
authorjsg <jsg@openbsd.org>
Fri, 12 May 2023 11:21:13 +0000 (11:21 +0000)
committerjsg <jsg@openbsd.org>
Fri, 12 May 2023 11:21:13 +0000 (11:21 +0000)
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

index 83013ee..0345a52 100644 (file)
@@ -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);