svn commit: r185021 - head/sys/dev/glxsb

Philip Paeps philip at freebsd.org
Mon Nov 17 10:27:47 PST 2008


On 2008-11-17 17:51:52 (+0100), Pawel Jakub Dawidek <pjd at FreeBSD.org> wrote:
> On Mon, Nov 17, 2008 at 07:09:40AM +0000, Philip Paeps wrote:
> > Fix two possible (but unlikely) NULL-pointer dereferences in glxsb(4).
> >
> > [...]
> >
> > -	while ((ses = TAILQ_FIRST(&sc->sc_sessions)) != NULL) {
> > +	while (!TAILQ_EMPTY(&sc->sc_sessions)) {
> > +		ses = TAILQ_FIRST(&sc->sc_sessions);
> 
> This is perfectly valid, and if it was reported by coverity, it is a
> false positive.

True.  Sorry for the noise.
Reminds me to find a way to get Coverity not to complain about this.

> > -	if (crp == NULL ||
> > -	    crp->crp_callback == NULL || crp->crp_desc == NULL) {
> > +	/* Sanity check. */
> > +	if (crp == NULL)
> > +		return (EINVAL);
> > +
> > +	if (crp->crp_callback == NULL || crp->crp_desc == NULL) {
> >  		error = EINVAL;
> >  		goto fail;
> >  	}
> 
> This one is ok. The same one exists in padlock(4), could you fix it too?

Will do.  Thanks.

 - Philip

-- 
Philip Paeps                                    Please don't Cc me, I am
philip at freebsd.org                               subscribed to the list.

  The worse your line is tangled, the better is the
  fishing around you.


More information about the svn-src-head mailing list