[PATCH] glx: fixup deref of null pointer when glx screen init fails.

Luc Verhaegen libv at skynet.be
Fri Oct 2 04:18:22 PDT 2009


On Thu, Oct 01, 2009 at 10:50:09AM -0700, Ian Romanick wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dave Airlie wrote:
> > From: Dave Airlie <airlied at linux.ie>
> > 
> > I think this is what the original author wanted.
> > 
> > Signed-off-by: Dave Airlie <airlied at redhat.com>
> 
> Acked-by: Ian Romanick <ian.d.romanick at intel.com>
> 
> I can't believe this got by Jesse and Kristian when they reviewed the
> original patch.  I need to go clean the egg off my face...
> 
> > ---
> >  glx/glxext.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/glx/glxext.c b/glx/glxext.c
> > index 2de8b84..0737420 100644
> > --- a/glx/glxext.c
> > +++ b/glx/glxext.c
> > @@ -364,14 +364,14 @@ void GlxExtensionInit(void)
> >  
> >  	    glxScreen = p->screenProbe(pScreen);
> >  	    if (glxScreen != NULL) {
> > +	    	if (glxScreen->GLXminor < glxMinorVersion)
> > +		    glxMinorVersion = glxScreen->GLXminor;
> >  		LogMessage(X_INFO,
> >  			   "GLX: Initialized %s GL provider for screen %d\n",
> >  			   p->name, i);
> >  		break;
> >  	    }
> >  
> > -	    if (glxScreen->GLXminor < glxMinorVersion)
> > -		glxMinorVersion = glxScreen->GLXminor;
> >  	}
> >  
> >  	if (!p)

Why is this chunk there in the first place? It feels as if it has no 
direct connection to the commit message of ad5c0d9efa, namely:

  GLX: Enable GLX 1.4 on DRI2
    
  Return the minimum GLX version supported by all screens.  Assume that
  DRI2 screens have all the required features for GLX 1.4.  Assume that
  everyone else can only support GLX 1.2.

or that it was not mentioned.

glxMajor/MinorVersion are only set for DRI and are never altered or used 
for DRI2.



More information about the xorg-devel mailing list