[Mesa-dev] [PATCH v1 1/4] freedreno/a2xx: Check for fd2_emit_state to failures.

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


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

Make sure that fd2_emit_state does not fail. If it does fail, some of shader
data structes may be de-allocated.

coverity: 1362467
Signed-off-by: Robert Foss <robert.foss at collabora.com>
---
 src/gallium/drivers/freedreno/a2xx/fd2_draw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_draw.c b/src/gallium/drivers/freedreno/a2xx/fd2_draw.c
index 14620ac..df5cf77 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_draw.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_draw.c
@@ -87,7 +87,8 @@ fd2_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
 	if (ctx->dirty & FD_DIRTY_VTXBUF)
 		emit_vertexbufs(ctx);
 
-	fd2_emit_state(ctx, ctx->dirty);
+	if (fd2_emit_state(ctx, ctx->dirty) == false)
+		return false;
 
 	OUT_PKT3(ring, CP_SET_CONSTANT, 2);
 	OUT_RING(ring, CP_REG(REG_A2XX_VGT_INDX_OFFSET));
-- 
2.7.4



More information about the mesa-dev mailing list