[Mesa-stable] [PATCH] ralloc: Fix ralloc_adopt() to the old context's last child's parent.

Kenneth Graunke kenneth at whitecape.org
Fri Dec 18 03:48:08 PST 2015


I was cleverly using one iteration to obtain a pointer to the last item
in ralloc's singly list child list, while also setting parents.

Unfortunately, I forgot to set the parent on that last item.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: "11.1 11.0 10.6" <mesa-stable at lists.freedesktop.org>
---
 src/util/ralloc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/ralloc.c b/src/util/ralloc.c
index bb4cf96..6d4032b 100644
--- a/src/util/ralloc.c
+++ b/src/util/ralloc.c
@@ -293,6 +293,7 @@ ralloc_adopt(const void *new_ctx, void *old_ctx)
 
    /* Connect the two lists together; parent them to new_ctx; make old_ctx empty. */
    child->next = new_info->child;
+   child->parent = new_info;
    new_info->child = old_info->child;
    old_info->child = NULL;
 }
-- 
2.6.3



More information about the mesa-stable mailing list