All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harish Chegondi <harish.chegondi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
Date: Fri, 17 Dec 2021 08:02:55 -0800	[thread overview]
Message-ID: <20211217160255.1300348-1-harish.chegondi@intel.com> (raw)

Check return pointer from intel_crtc_for_plane() before dereferencing
it, as it can be NULL.

v2: Moved the NULL check into intel_crtc_active().

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Caz Yokoyama <caz.yokoyama@intel.com>
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index bdf97a8c9ef3..8b357ec35a4a 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -877,7 +877,7 @@ static bool intel_crtc_active(struct intel_crtc *crtc)
 	 * crtc->state->active once we have proper CRTC states wired up
 	 * for atomic.
 	 */
-	return crtc->active && crtc->base.primary->state->fb &&
+	return crtc && crtc->active && crtc->base.primary->state->fb &&
 		crtc->config->hw.adjusted_mode.crtc_clock;
 }
 
-- 
2.31.1


             reply	other threads:[~2021-12-17 16:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 16:02 Harish Chegondi [this message]
2021-12-17 16:08 ` [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() Ville Syrjälä
2021-12-22  8:30   ` Jani Nikula
2021-12-17 17:48 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() (rev2) Patchwork
2021-12-22 10:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() (rev3) Patchwork
2021-12-22 12:40 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-01-07 15:57 ` Patchwork
2022-01-07 16:21 ` Patchwork
2022-01-07 19:25 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
2022-01-07 21:37   ` 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=20211217160255.1300348-1-harish.chegondi@intel.com \
    --to=harish.chegondi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /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.