All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/locking: Allow NULL crtc in drm_modeset_legacy_acquire_ctx
@ 2014-11-21 15:40 Daniel Vetter
  2014-11-21 16:21 ` Ville Syrjälä
  2014-11-21 16:55 ` Daniel Vetter
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Vetter @ 2014-11-21 15:40 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Jasper St. Pierre, DRI Development, Daniel Vetter

I've missed checking this and so didn't notice that there's a NULL
check missing. Since depending upon calling context the crtc might not
even be there (disable-me-harder does happen around planes, especially
in cleanup code) we need to dodge the oops and look at the global
acquire ctx.

Reported-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Cc: "Jasper St. Pierre" <jstpierre@mecheye.net>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_modeset_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index 474e4d12a2d8..93d28269e3bd 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -209,7 +209,7 @@ EXPORT_SYMBOL(drm_modeset_lock_crtc);
 struct drm_modeset_acquire_ctx *
 drm_modeset_legacy_acquire_ctx(struct drm_crtc *crtc)
 {
-	if (crtc->acquire_ctx)
+	if (crtc && crtc->acquire_ctx)
 		return crtc->acquire_ctx;
 
 	WARN_ON(!crtc->dev->mode_config.acquire_ctx);
-- 
2.1.1

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

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

end of thread, other threads:[~2014-11-24 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-21 15:40 [PATCH] drm/locking: Allow NULL crtc in drm_modeset_legacy_acquire_ctx Daniel Vetter
2014-11-21 16:21 ` Ville Syrjälä
2014-11-21 16:55 ` Daniel Vetter
2014-11-23  5:50   ` [PATCH] drm/locking: Allow NULL crtc in shuang.he
2014-11-24 21:38   ` [PATCH] drm/locking: Allow NULL crtc in drm_modeset_legacy_acquire_ctx Jasper St. Pierre

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.