aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2631-amdgpu-dc-Avoid-dereferencing-NULL-pointer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2631-amdgpu-dc-Avoid-dereferencing-NULL-pointer.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2631-amdgpu-dc-Avoid-dereferencing-NULL-pointer.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2631-amdgpu-dc-Avoid-dereferencing-NULL-pointer.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2631-amdgpu-dc-Avoid-dereferencing-NULL-pointer.patch
new file mode 100644
index 00000000..b3792ca1
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2631-amdgpu-dc-Avoid-dereferencing-NULL-pointer.patch
@@ -0,0 +1,45 @@
+From 928f107df7c92160f9a1c78550e4cd1d08fa18cc Mon Sep 17 00:00:00 2001
+From: Drew Davenport <ddavenport@chromium.org>
+Date: Fri, 27 Oct 2017 12:34:46 -0600
+Subject: [PATCH 2631/4131] amdgpu/dc: Avoid dereferencing NULL pointer
+
+crtc is dereferenced from within drm_atomic_get_new_crtc_state, so
+check for NULL before initializing new_crtc_state.
+
+Signed-off-by: Drew Davenport <ddavenport@chromium.org>
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+index 76990cb..7b783b1 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -4044,8 +4044,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
+ /* update planes when needed */
+ for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
+ struct drm_crtc *crtc = new_plane_state->crtc;
+- struct drm_crtc_state *new_crtc_state =
+- drm_atomic_get_new_crtc_state(state, crtc);
++ struct drm_crtc_state *new_crtc_state;
+ struct drm_framebuffer *fb = new_plane_state->fb;
+ bool pflip_needed;
+ struct dm_plane_state *dm_new_plane_state = to_dm_plane_state(new_plane_state);
+@@ -4055,7 +4054,11 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
+ continue;
+ }
+
+- if (!fb || !crtc || pcrtc != crtc || !new_crtc_state->active)
++ if (!fb || !crtc || pcrtc != crtc)
++ continue;
++
++ new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
++ if (!new_crtc_state->active)
+ continue;
+
+ pflip_needed = !state->allow_modeset;
+--
+2.7.4
+