All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/5] Fixing Possible Null Pointer Dereference
@ 2020-08-24  3:45 Nischal Varide
  2020-08-24  3:45 ` [Intel-gfx] [PATCH 2/5] " Nischal Varide
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Nischal Varide @ 2020-08-24  3:45 UTC (permalink / raw)
  To: intel-gfx, nischal.varide

There is a possble Null Pointer dereference in intel_atomic.c and this
patch fixes the same by introducting a check to old_state, new_state
old_conn_state and new_conn_state variables.

Signed-off-by: Nischal Varide <nischal.varide@intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index 630f49b7aa01..ab58f061c8a7 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -132,6 +132,9 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
 		to_intel_digital_connector_state(old_state);
 	struct drm_crtc_state *crtc_state;
 
+	if (!(new_state && new_conn_state && old_state && old_conn_state))
+		return 0;
+
 	intel_hdcp_atomic_check(conn, old_state, new_state);
 	intel_psr_atomic_check(conn, old_state, new_state);
 
@@ -192,6 +195,8 @@ intel_connector_needs_modeset(struct intel_atomic_state *state,
 
 	old_conn_state = drm_atomic_get_old_connector_state(&state->base, connector);
 	new_conn_state = drm_atomic_get_new_connector_state(&state->base, connector);
+	if (!(old_conn_state && new_conn_state))
+		return 0;
 
 	return old_conn_state->crtc != new_conn_state->crtc ||
 	       (new_conn_state->crtc &&
-- 
2.26.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-27  6:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-24  3:45 [Intel-gfx] [PATCH 1/5] Fixing Possible Null Pointer Dereference Nischal Varide
2020-08-24  3:45 ` [Intel-gfx] [PATCH 2/5] " Nischal Varide
2020-08-24  3:45 ` [Intel-gfx] [PATCH 3/5] Fixing a " Nischal Varide
2020-08-24  3:45 ` [Intel-gfx] [PATCH 4/5] Fixing " Nischal Varide
2020-08-24  3:45 ` [Intel-gfx] [PATCH 5/5] Fixing a " Nischal Varide
2020-08-24 10:51 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] Fixing " Patchwork
2020-08-24 11:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-08-24 14:06 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-08-24 19:58 ` [Intel-gfx] [PATCH 1/5] " Ville Syrjälä
2020-08-27  6:49   ` Shankar, Uma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.