diff options
author | Rob Clark <rob@ti.com> | 2012-04-20 17:36:38 -0500 |
---|---|---|
committer | Rob Clark <rob@ti.com> | 2012-04-20 19:18:09 -0500 |
commit | 1272ef49f75295d462799910007cb07367c1d35a (patch) | |
tree | d668ed159f6ee825941c96a59c28e68bb0be1acb | |
parent | 834f6469c312b0e46921aad563f137ca5b2f1b14 (diff) |
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.
-rw-r--r-- | src/omap_exa.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); } |