]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: Check link_res->hpo_dp_link_enc before using it
authorAlex Hung <alex.hung@amd.com>
Thu, 27 Jun 2024 22:45:39 +0000 (16:45 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:37:43 +0000 (16:37 +0200)
commit0508a4e95ac1aefd851ceb97ea050d8abb93262c
tree4bd3fb07d8643b8fb0186d50c56702ae23e87d29
parent43ebd0faec24652cb529ceefd594c61897059f90
drm/amd/display: Check link_res->hpo_dp_link_enc before using it

[ Upstream commit 0beca868cde8742240cd0038141c30482d2b7eb8 ]

[WHAT & HOW]
Functions dp_enable_link_phy and dp_disable_link_phy can pass link_res
without initializing hpo_dp_link_enc and it is necessary to check for
null before dereferencing.

This fixes 2 FORWARD_NULL issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c