lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170803101233.ps5lgtocr3hlb4sf@phenom.ffwll.local>
Date:   Thu, 3 Aug 2017 12:12:33 +0200
From:   Daniel Vetter <daniel@...ll.ch>
To:     David Lechner <david@...hnology.com>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Daniel Vetter <daniel.vetter@...el.com>
Subject: Re: [PATCH] drm/fb: Fix pointer dereference before null check.

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@...hnology.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@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ