aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0734-drm-amd-display-Guard-against-null-stream_state-in-s.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0734-drm-amd-display-Guard-against-null-stream_state-in-s.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0734-drm-amd-display-Guard-against-null-stream_state-in-s.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0734-drm-amd-display-Guard-against-null-stream_state-in-s.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0734-drm-amd-display-Guard-against-null-stream_state-in-s.patch
new file mode 100644
index 00000000..300c3ab9
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0734-drm-amd-display-Guard-against-null-stream_state-in-s.patch
@@ -0,0 +1,45 @@
+From fb57e8518d6658dfa2f3a0b1c57cdfa2a1748ccc Mon Sep 17 00:00:00 2001
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Date: Thu, 18 Oct 2018 15:49:41 -0400
+Subject: [PATCH 0734/2940] drm/amd/display: Guard against null stream_state in
+ set_crc_source
+
+[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>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+index 01fc5717b657..f088ac585978 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+@@ -75,6 +75,11 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
+ return -EINVAL;
+ }
+
++ if (!stream_state) {
++ DRM_ERROR("No stream state for CRTC%d\n", crtc->index);
++ return -EINVAL;
++ }
++
+ /* When enabling CRC, we should also disable dithering. */
+ if (source == AMDGPU_DM_PIPE_CRC_SOURCE_AUTO) {
+ if (dc_stream_configure_crc(stream_state->ctx->dc,
+--
+2.17.1
+