mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
util/ralloc: set prev-pointers correctly in ralloc_adopt
Found by inspection. I'm not aware of any actual failures caused by this, but a precise sequence of ralloc_adopt and ralloc_free should be able to cause problems. v2: make the code slightly clearer (Eric) Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
94f740e3fc
commit
1e247511e5
1 changed files with 3 additions and 1 deletions
|
|
@ -311,10 +311,12 @@ ralloc_adopt(const void *new_ctx, void *old_ctx)
|
|||
for (child = old_info->child; child->next != NULL; child = child->next) {
|
||||
child->parent = new_info;
|
||||
}
|
||||
child->parent = new_info;
|
||||
|
||||
/* Connect the two lists together; parent them to new_ctx; make old_ctx empty. */
|
||||
child->next = new_info->child;
|
||||
child->parent = new_info;
|
||||
if (child->next)
|
||||
child->next->prev = child;
|
||||
new_info->child = old_info->child;
|
||||
old_info->child = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue