From: Patrick Lerda Date: Mon, 29 Apr 2019 08:43:51 +0000 (+0200) Subject: lima/ppir: fix pointer referenced after a free X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=812288bf0f65c360fd93803d14f1c74754835535;p=mesa.git 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 --- 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);