drm/amd/display: Fix null pointer dereference for encoders
authorJimmy Kizito <Jimmy.Kizito@amd.com>
Sun, 12 Sep 2021 15:21:52 +0000 (11:21 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:11 +0000 (19:16 +0100)
commit678e8cd1bf22e1553ebf843e6ddab74083c6e936
treeb966e9ee05e4b798ca9e94622d0ad883c20a976b
parent351601af203da6404d2c0d87e0c10406bdc151bd
drm/amd/display: Fix null pointer dereference for encoders

[ Upstream commit 60f39edd897ea134a4ddb789a6795681691c3183 ]

[Why]
Links which are dynamically assigned link encoders have their link
encoder set to NULL.

[How]
Check that a pointer to a link_encoder object is non-NULL before using
it.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@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/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c