[Intel-gfx] [PATCH 3/5] Fixing a Possible Null Pointer Dereference.
Nischal Varide
nischal.varide at intel.com
Mon Aug 24 03:45:54 UTC 2020
This Patch addresses a Possible Null Pointer Dereference of variables
new_stae, new_conn_state and old_state, old_conn_state in intel_sdvo.c
Signed-off-by: Nischal Varide <nischal.varide at intel.com>
---
drivers/gpu/drm/i915/display/intel_sdvo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index 2da4388e1540..186a2d695bb6 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -2505,6 +2505,9 @@ static int intel_sdvo_atomic_check(struct drm_connector *conn,
struct intel_sdvo_connector_state *new_state =
to_intel_sdvo_connector_state(new_conn_state);
+ if (!(new_conn_state && old_conn_state && old_state && new_state))
+ return 0;
+
if (new_conn_state->crtc &&
(memcmp(&old_state->tv, &new_state->tv, sizeof(old_state->tv)) ||
memcmp(&old_conn_state->tv, &new_conn_state->tv, sizeof(old_conn_state->tv)))) {
--
2.26.0
More information about the Intel-gfx
mailing list