From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/locking: Allow NULL crtc in drm_modeset_legacy_acquire_ctx
Date: Fri, 21 Nov 2014 18:21:20 +0200 [thread overview]
Message-ID: <20141121162119.GE10649@intel.com> (raw)
In-Reply-To: <1416584418-17994-1-git-send-email-daniel.vetter@ffwll.ch>
On Fri, Nov 21, 2014 at 04:40:18PM +0100, Daniel Vetter wrote:
> 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);
^^^^^^
How's that going to work without the crtc?
> --
> 2.1.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-11-21 16:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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ä [this message]
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
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=20141121162119.GE10649@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox