[PATCH 0/3] drm: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-09-24 Thread li.xi...@freescale.com
Ping :)

Thanks,

BRs
Xiubo



> -Original Message-
> From: Xiubo Li [mailto:Li.Xiubo at freescale.com]
> Sent: Tuesday, August 12, 2014 11:30 AM
> To: airlied at linux.ie; dri-devel at lists.freedesktop.org
> Cc: Xiubo Li-B47053
> Subject: [PATCH 0/3] drm: Fix possible ZERO_SIZE_PTR pointer dereferencing
> error.
> 
> 
> Xiubo Li (3):
>   drm/bufs: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
>   drm/crtc: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
>   drm/global: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
> 
>  drivers/gpu/drm/drm_bufs.c   | 12 +---
>  drivers/gpu/drm/drm_crtc.c   | 14 +++---
>  drivers/gpu/drm/drm_global.c |  5 +
>  3 files changed, 25 insertions(+), 6 deletions(-)
> 
> --
> 1.8.5



[PATCH] drm/fb-helper: Do the mode_set.connectors ZERO_SIZE_PTR check

2014-03-10 Thread li.xi...@freescale.com

> Subject: Re: [PATCH] drm/fb-helper: Do the mode_set.connectors ZERO_SIZE_PTR
> check
> 
> On Thu, 06 Mar 2014, Xiubo Li  wrote:
> > Since we cannot make sure the 'max_conn_count' will always be none
> > zero from the users, and then if max_conn_count equals to zero, the
> > kcalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16).
> >
> > So this patch fix this via doing the zero pionter check of it.
> 
> Please just add a check for max_conn_count == 0 up front and handle it.
> 
> BR,
> Jani.
> 

Yes, that's one better choice.
See the next version please.

Thanks very much!

--
Best Regards,
Xiubo 

> 
> >
> > Signed-off-by: Xiubo Li 
> > ---
> >  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 3d13ca6e2..c6680ef 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -536,7 +536,7 @@ int drm_fb_helper_init(struct drm_device *dev,
> > sizeof(struct drm_connector *),
> > GFP_KERNEL);
> >
> > -   if (!fb_helper->crtc_info[i].mode_set.connectors)
> > +   if 
> > (ZERO_OR_NULL_PTR(fb_helper->crtc_info[i].mode_set.connectors))
> > goto out_free;
> > fb_helper->crtc_info[i].mode_set.num_connectors = 0;
> > }
> > --
> > 1.8.4
> >
> >
> > ___
> > dri-devel mailing list
> > dri-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> --
> Jani Nikula, Intel Open Source Technology Center
>