public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
@ 2021-12-17 16:02 Harish Chegondi
  2021-12-17 16:08 ` Ville Syrjälä
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Harish Chegondi @ 2021-12-17 16:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula

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


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

end of thread, other threads:[~2022-01-07 21:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-17 16:02 [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() Harish Chegondi
2021-12-17 16:08 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox