]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Fix null pointer dereference in error message
authorCong Liu <liucong2@kylinos.cn>
Tue, 26 Sep 2023 05:56:17 +0000 (13:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:57:01 +0000 (11:57 +0100)
[ Upstream commit 0c3601a2fbfb265ce283651480e30c8e60459112 ]

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: 9788d087caff ("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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index c9959bd8147db71b719ab7205dc2309727b84694..83d670f0d199b5a13afeb973408f093a6452dbf1 100644 (file)
@@ -1690,8 +1690,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;
        }