From: Samuel Pitoiset Date: Wed, 16 Dec 2015 21:54:30 +0000 (+0100) Subject: nv50: free memory allocated by the prog which reads MP perf counters X-Git-Tag: upstream/17.1.0~13638 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=695ae816da2fd9739eac769820bee8b7b4a87d95;p=platform%2Fupstream%2Fmesa.git nv50: free memory allocated by the prog which reads MP perf counters This fixes a memory leak introduced in 6a9c151 ("nv50: add compute-related MP perf counters on G84+") Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin Cc: "11.1" --- diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 1e4b75f..ee43d8f 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -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);