[PATCH xf86-video-ati 02/15] glamor: Fix leak of pixmap private when replacing BO

Michel Dänzer michel at daenzer.net
Wed Sep 21 09:50:41 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Reported-by: Qiang Yu <qiang.yu at amd.com>
(Ported from amdgpu commit 397aedafee437c125b8ac1feafb1c3b466842aeb)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_glamor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 7a6bf53..b66848f 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -314,10 +314,9 @@ radeon_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap)
 		FreeScratchGC(gc);
 	}
 
-	radeon_set_pixmap_private(pixmap, NULL);
-
 	/* And redirect the pixmap to the new bo (for 3D). */
 	glamor_egl_exchange_buffers(old, pixmap);
+	radeon_set_pixmap_private(pixmap, radeon_get_pixmap_private(old));
 	radeon_set_pixmap_private(old, priv);
 
 	screen->ModifyPixmapHeader(old,
-- 
2.9.3



More information about the amd-gfx mailing list