mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: David Lechner <david@lechnology.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/fb: Fix pointer dereference before null check.
Date: Thu, 3 Aug 2017 12:12:33 +0200	[thread overview]
Message-ID: <20170803101233.ps5lgtocr3hlb4sf@phenom.ffwll.local> (raw)
In-Reply-To: <1501696813-8807-1-git-send-email-david@lechnology.com>

On Wed, Aug 02, 2017 at 01:00:13PM -0500, David Lechner wrote:
> fb_crtc is used before a null check, so move the use after the null check.
> 
> This was just identified by inspection. I haven't actually observed a crash
> here, so it is possible that the null check could be unnecessary.
> 
> Signed-off-by: David Lechner <david@lechnology.com>

Thanks, applied.
-Daniel

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 2cc28f0..2d3f93e 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2424,9 +2424,9 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
>  		struct drm_display_mode *mode = modes[i];
>  		struct drm_fb_helper_crtc *fb_crtc = crtcs[i];
>  		struct drm_fb_offset *offset = &offsets[i];
> -		struct drm_mode_set *modeset = &fb_crtc->mode_set;
>  
>  		if (mode && fb_crtc) {
> +			struct drm_mode_set *modeset = &fb_crtc->mode_set;
>  			struct drm_connector *connector =
>  				fb_helper->connector_info[i]->connector;
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

      reply	other threads:[~2017-08-03 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 18:00 David Lechner
2017-08-03 10:12 ` Daniel Vetter [this message]

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=20170803101233.ps5lgtocr3hlb4sf@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®