From: Dave Airlie Date: Thu, 3 Sep 2015 22:02:14 +0000 (+1000) Subject: r600: fix loop overrun in cayman_mul_double_instr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fa5a012b163bad80d01a65e2947510f15e1be6b;p=mesa.git r600: fix loop overrun in cayman_mul_double_instr Coverity warned about this. Ilia pointed it out. Signed-off-by: Dave Airlie --- diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 9043668a532..78904da13c3 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -3194,7 +3194,7 @@ static int cayman_mul_double_instr(struct r600_shader_ctx *ctx) int lasti = tgsi_last_instruction(inst->Dst[0].Register.WriteMask); int t1 = ctx->temp_reg; - for (k = 0; k <= 2; k++) { + for (k = 0; k < 2; k++) { if (!(inst->Dst[0].Register.WriteMask & (0x3 << (k * 2)))) continue;