[Mesa-dev] [PATCH v1 4/4] freedreno/a2xx: Make delete_shader set the ptr to NULL to simplify debugging.

robert.foss at collabora.com robert.foss at collabora.com
Tue Jun 7 09:33:39 UTC 2016


From: Robert Foss <robert.foss at collabora.com>

Make delete_shader set the fd2_shader_stateobj ptr to NULL, to simplify
debugging and finding use after free errors.

Signed-off-by: Robert Foss <robert.foss at collabora.com>
---
 src/gallium/drivers/freedreno/a2xx/fd2_program.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_program.c b/src/gallium/drivers/freedreno/a2xx/fd2_program.c
index 1819c52..5925f49 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_program.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_program.c
@@ -58,6 +58,7 @@ delete_shader(struct fd2_shader_stateobj *so)
 	free(so->tokens);
 	free(so->bin);
 	free(so);
+	so = NULL;
 }
 
 static struct fd2_shader_stateobj *
-- 
2.7.4



More information about the mesa-dev mailing list