All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nischal Varide <nischal.varide@intel.com>
To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com
Subject: [Intel-gfx] [PATCH 3/5] Fixing a Possible Null Pointer Dereference.
Date: Mon, 24 Aug 2020 09:15:54 +0530	[thread overview]
Message-ID: <20200824034556.26626-3-nischal.varide@intel.com> (raw)
In-Reply-To: <20200824034556.26626-1-nischal.varide@intel.com>

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@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

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

  parent reply	other threads:[~2020-08-24 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Nischal Varide [this message]
2020-08-24  3:45 ` [Intel-gfx] [PATCH 4/5] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200824034556.26626-3-nischal.varide@intel.com \
    --to=nischal.varide@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.