[Mesa-stable] [PATCH 6/6] freedreno/ir3: fix potential null ptr deref

Rob Clark robdclark at gmail.com
Tue Sep 2 13:16:25 PDT 2014


From: Rob Clark <robclark at freedesktop.org>

Fix potential segfault in debug code.

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/drivers/freedreno/ir3/ir3_dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_dump.c b/src/gallium/drivers/freedreno/ir3/ir3_dump.c
index 1a6f49d..6133628 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_dump.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_dump.c
@@ -322,7 +322,8 @@ static void ir3_block_dump(struct ir3_dump_ctx *ctx,
 
 	/* draw instruction graph: */
 	for (i = 0; i < block->noutputs; i++)
-		dump_instr(ctx, block->outputs[i]);
+		if (block->outputs[i])
+			dump_instr(ctx, block->outputs[i]);
 
 	/* draw outputs: */
 	fprintf(ctx->f, "output%lx [shape=record,label=\"outputs", PTRID(block));
-- 
1.9.3



More information about the mesa-stable mailing list