nv50: free memory allocated by the prog which reads MP perf counters
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 16 Dec 2015 21:54:30 +0000 (22:54 +0100)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 17 Dec 2015 02:52:43 +0000 (21:52 -0500)
This fixes a memory leak introduced in 6a9c151
("nv50: add compute-related MP perf counters on G84+")

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.1" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/nv50/nv50_screen.c

index 1e4b75f18e039b76d77211a7f6db90b344d2a596..ee43d8ff53533206d14d618d3b99e791eb1c8243 100644 (file)
@@ -405,6 +405,11 @@ nv50_screen_destroy(struct pipe_screen *pscreen)
 
    if (screen->blitter)
       nv50_blitter_destroy(screen);
+   if (screen->pm.prog) {
+      screen->pm.prog->code = NULL; /* hardcoded, don't FREE */
+      nv50_program_destroy(NULL, screen->pm.prog);
+      FREE(screen->pm.prog);
+   }
 
    nouveau_bo_ref(NULL, &screen->code);
    nouveau_bo_ref(NULL, &screen->tls_bo);