From 1272ef49f75295d462799910007cb07367c1d35a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 20 Apr 2012 17:36:38 -0500 Subject: exa: fix double free of scanout bo When the screen is torn down and the screen pixmap destroyed, we should not delete the bo, as it is freed elsewhere. TODO: add refcnting in libdrm_omap so this can be handled in a cleaner way. --- src/omap_exa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/omap_exa.c b/src/omap_exa.c index 3d175fa..15c396f 100644 --- a/src/omap_exa.c +++ b/src/omap_exa.c @@ -75,8 +75,13 @@ _X_EXPORT void OMAPDestroyPixmap(ScreenPtr pScreen, void *driverPriv) { OMAPPixmapPrivPtr priv = driverPriv; + OMAPPtr pOMAP = OMAPPTR_FROM_SCREEN(pScreen); - omap_bo_del(priv->bo); + /* scanout buffer is deleted elsewhere.. some refcnt'ing would + * make this a bit cleaner.. + */ + if (priv->bo != pOMAP->scanout) + omap_bo_del(priv->bo); free(priv); } -- cgit v1.2.3