[PATCH xf86-video-ati 1/4] Free pRADEONEnt memory in RADEONFreeRec

Michel Dänzer michel at daenzer.net
Fri Oct 20 15:28:17 UTC 2017


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

We were leaking it.

(Inspired by amdgpu commit 9d84934309e4ccd9a43c73d958b8ff10ef2fc990)

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

diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 9ef51693a..df438768c 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -218,7 +218,8 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn)
                     pRADEONEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
 #endif
                 drmClose(pRADEONEnt->fd);
-            pRADEONEnt->fd = 0;
+            free(pPriv->ptr);
+            pPriv->ptr = NULL;
         }
     }
 
-- 
2.14.2



More information about the amd-gfx mailing list