drm/amd/display: Guard against null stream_state in set_crc_source
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Thu, 18 Oct 2018 19:49:41 +0000 (15:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jan 2019 08:32:33 +0000 (09:32 +0100)
commit07f4cf9547d92cb7205f2bac9bce81164ad627f9
treec1ac6e01a1bd60c3f495ce99f89d18dc4ea7bd5e
parent414dbd6c00b97035490e8ff659c83aeeb501c7e3
drm/amd/display: Guard against null stream_state in set_crc_source

[ Upstream commit f41a895026b8cb6f765190de7d2e7bc3ccbbd183 ]

[Why]

The igt@kms_plane@pixel-format-pipe tests can create a sequence where
stream_state is NULL during amdgpu_dm_crtc_set_crc_source which results
in a null pointer dereference.

[How]

Guard against stream_state being NULL before accessing its fields. This
doesn't fix the root cause of the issue so a DRM_ERROR is generated
to still fail the tests.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Leo Li <sunpeng.li@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_crc.c