[PATCH 1/4] fb: fix screen pixmap leak on server reset

Julien Cristau jcristau at debian.org
Thu Jun 26 02:39:48 PDT 2014


On Thu, May 22, 2014 at 16:54:10 -0700, Keith Packard wrote:

> Frank Binns <frank.binns at imgtec.com> writes:
> 
> > From: Brendan King <brendan.king at imgtec.com>
> >
> > Call FreePixmap() instead of free() to destroy the screen pixmap in
> > fbCloseScreen().
> >
> > Signed-off-by: Frank Binns <frank.binns at imgtec.com>
> > ---
> >  fb/fbscreen.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fb/fbscreen.c b/fb/fbscreen.c
> > index b2b9739..1f91089 100644
> > --- a/fb/fbscreen.c
> > +++ b/fb/fbscreen.c
> > @@ -37,7 +37,7 @@ fbCloseScreen(ScreenPtr pScreen)
> >          free(depths[d].vids);
> >      free(depths);
> >      free(pScreen->visuals);
> > -    free(pScreen->devPrivate);
> > +    FreePixmap((PixmapPtr)pScreen->devPrivate);
> >      return TRUE;
> >  }
> 
> This fixes the devPrivates counts and nothing else, so we'll reduce the
> warnings on recycle.
> 
> Reviewed-by: Keith Packard <keithp at keithp.com>
> 
This breaks Xvfb:
https://bugs.freedesktop.org/show_bug.cgi?id=80313

pScreen->devPrivate is NULL, so we crash trying to dereference it in
FreePixmap(), whereas the free() was a no-op.

Cheers,
Julien


More information about the xorg-devel mailing list