Commit 52f1783f authored by Igor Artemiev's avatar Igor Artemiev Committed by Alex Deucher
Browse files

drm/amd/display: Fix potential null dereference



The adev->dm.dc pointer can be NULL and dereferenced in amdgpu_dm_fini()
without checking.

Add a NULL pointer check before calling dc_dmub_srv_destroy().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9a71c7d3 ("drm/amd/display: Register DMUB service with DC")
Signed-off-by: default avatarIgor Artemiev <Igor.A.Artemiev@mcst.ru>
Signed-off-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e38dddca
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1890,6 +1890,7 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
	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)) {