All of lore.kernel.org
 help / color / mirror / Atom feed
From: clinton.a.taylor@intel.com
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915/icl: Prevent possibe de-reference in skl_check_pipe_max_pixel_clock.
Date: Mon, 15 Apr 2019 20:12:50 -0700	[thread overview]
Message-ID: <20190416031250.21690-1-clinton.a.taylor@intel.com> (raw)

From: Clint Taylor <clinton.a.taylor@intel.com>

Add protections to prevent NULL de-reference for a couple variables used
in skl_check_pipe_max_pixel_clock to prevent GP exception from occurring
during some IGT tests.

References: https://bugs.freedesktop.org/show_bug.cgi?id=109084

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 drivers/gpu/drm/i915/intel_pm.c      | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3bd40a4a6739..945861cef520 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11377,6 +11377,10 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
 
 		if (!ret)
 			ret = icl_check_nv12_planes(pipe_config);
+
+		if (WARN_ON(!intel_crtc))
+			return -EINVAL;
+
 		if (!ret)
 			ret = skl_check_pipe_max_pixel_rate(intel_crtc,
 							    pipe_config);
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7357bddf9ad9..df5d01d4345b 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4160,6 +4160,9 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
 		uint_fixed_16_16_t fp_9_div_8 = div_fixed16(9, 8);
 		int bpp;
 
+		if (WARN_ON(!pstate))
+			return -EINVAL;
+
 		if (!intel_wm_plane_visible(cstate,
 					    to_intel_plane_state(pstate)))
 			continue;
-- 
2.19.1

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

             reply	other threads:[~2019-04-16  4:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  3:12 clinton.a.taylor [this message]
2019-04-16  4:36 ` ✓ Fi.CI.BAT: success for drm/i915/icl: Prevent possibe de-reference in skl_check_pipe_max_pixel_clock Patchwork
2019-04-16  5:44 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-04-19 21:06 ` [PATCH] " Matt Roper
2019-04-19 21:12   ` Chris Wilson
2019-04-19 21:15     ` Matt Roper

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=20190416031250.21690-1-clinton.a.taylor@intel.com \
    --to=clinton.a.taylor@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.