From 4e75d757244f7f0b727ff2eaaa06c94e805e8474 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 23 Dec 2019 15:49:18 -0500 Subject: [PATCH] pan/midgard: Bounds check lcra_restrict_range We may call it with sentinel values (~0 in particular) corresponding to unused arguments; ignore these. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/lcra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/midgard/lcra.c b/src/panfrost/midgard/lcra.c index a280a744b92..28f9a735a44 100644 --- a/src/panfrost/midgard/lcra.c +++ b/src/panfrost/midgard/lcra.c @@ -101,7 +101,7 @@ lcra_set_disjoint_class(struct lcra_state *l, unsigned c1, unsigned c2) void lcra_restrict_range(struct lcra_state *l, unsigned node, unsigned len) { - if (l->alignment[node]) + if (node < l->node_count && l->alignment[node]) l->modulus[node] = DIV_ROUND_UP(l->bound - len + 1, 1 << (l->alignment[node] - 1)); } -- 2.30.2