Skip to contentSkip to conversation

Patch "drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic()" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jan 30, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic()

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-i915-check-for-null-atomic-state-in-intel_crtc_disable_noatomic.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 6d1d427a4e24c403b4adf928d61994bdaa0ca03a Mon Sep 17 00:00:00 2001

From: Ander Conselvan de Oliveira <[email protected]>
Date: Fri, 20 Jan 2017 16:28:45 +0200
Subject: drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Ander Conselvan de Oliveira <[email protected]>

commit 6d1d427a4e24c403b4adf928d61994bdaa0ca03a upstream.

In intel_crtc_disable_noatomic(), bail on a failure to allocate an atomic state to avoid a NULL pointer dereference.

Fixes 4a80655827af ("drm/i915: Pass atomic state to crtc enable/disable functions")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
(cherry picked from commit 31bb2ef97ea9db343348f9b5ccaa9bb6f48fc655)
---
 drivers/gpu/drm/i915/intel_display.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_display.c +6 -0
@@ -6869,6 +6869,12 @@ static void intel_crtc_disable_noatomic(
 	}
 
 	state = drm_atomic_state_alloc(crtc->dev);
+	if (!state) {
+		DRM_DEBUG_KMS("failed to disable [CRTC:%d:%s], out of memory",
+			      crtc->base.id, crtc->name);
+		return;
+	}
+
 	state->acquire_ctx = crtc->dev->mode_config.acquire_ctx;
 
 	/* Everything's already locked, -EDEADLK can't happen. */

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/drm-i915-don-t-init-hpd-polling-for-vlv-and-chv-from-runtime_suspend.patch queue-4.9/drm-i915-check-for-null-atomic-state-in-intel_crtc_disable_noatomic.patch queue-4.9/drm-i915-don-t-leak-edid-in-intel_crt_detect_ddc.patch queue-4.9/drm-i915-fix-calculation-of-rotated-x-and-y-offsets-for-planar-formats.patch