From 812288bf0f65c360fd93803d14f1c74754835535 Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Mon, 29 Apr 2019 10:43:51 +0200 Subject: [PATCH] lima/ppir: fix pointer referenced after a free Issue detected by valgrind. Fixes: 92d7ca4b1cd ("gallium: add lima driver") Signed-off-by: Patrick Lerda Reviewed-by: Qiang Yu --- src/gallium/drivers/lima/ir/pp/lower.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/lima/ir/pp/lower.c b/src/gallium/drivers/lima/ir/pp/lower.c index e294f6740d1..97243dcfa3f 100644 --- a/src/gallium/drivers/lima/ir/pp/lower.c +++ b/src/gallium/drivers/lima/ir/pp/lower.c @@ -94,8 +94,9 @@ static bool ppir_lower_dot(ppir_block *block, ppir_node *node) dest->write_mask = u_bit_consecutive(0, num_components); ppir_node_foreach_pred_safe(node, dep) { + ppir_node *pred = dep->pred; ppir_node_remove_dep(dep); - ppir_node_add_dep(&mul->node, dep->pred); + ppir_node_add_dep(&mul->node, pred); } ppir_node_add_dep(node, &mul->node); -- 2.30.2