drm/amd/display: Fix null pointer dereference in error message

[ Upstream commit 0c3601a2fb ]

This patch fixes a null pointer dereference in the error message that is
printed when the Display Core (DC) fails to initialize. The original
message includes the DC version number, which is undefined if the DC is
not initialized.

Fixes: 9788d087ca ("drm/amd/display: improve the message printed when loading DC")
Signed-off-by: Cong Liu <liucong2@kylinos.cn>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Cong Liu 2023-09-26 13:56:17 +08:00 committed by Greg Kroah-Hartman
parent 49ca8b9035
commit 8b72c5d4a5

View file

@ -1692,8 +1692,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
DRM_INFO("Display Core v%s initialized on %s\n", DC_VER,
dce_version_to_string(adev->dm.dc->ctx->dce_version));
} else {
DRM_INFO("Display Core v%s failed to initialize on %s\n", DC_VER,
dce_version_to_string(adev->dm.dc->ctx->dce_version));
DRM_INFO("Display Core failed to initialize with v%s!\n", DC_VER);
goto error;
}