Commit 3f1f32f7 authored by Nils Goroll's avatar Nils Goroll

fix panic in worklist_set_delivered

when we prune the tree, we may the current node containing the link
to the next unpending node may get freed, so we need to iterate using
the _SAFE variant which saves it.
parent 704b300d
...@@ -878,12 +878,12 @@ static void ...@@ -878,12 +878,12 @@ static void
worklist_set_delivered(struct req *req, struct bytes_tree *tree, worklist_set_delivered(struct req *req, struct bytes_tree *tree,
struct node_head *work) struct node_head *work)
{ {
struct node *node, *parent; struct node *node, *parent, *tmp;
CHECK_OBJ_NOTNULL(tree, BYTES_TREE_MAGIC); CHECK_OBJ_NOTNULL(tree, BYTES_TREE_MAGIC);
Lck_AssertHeld(&tree->tree_lock); Lck_AssertHeld(&tree->tree_lock);
VSTAILQ_FOREACH(node, work, unpend) { VSTAILQ_FOREACH_SAFE(node, work, unpend, tmp) {
set_delivered(tree, node); set_delivered(tree, node);
if (VSTAILQ_NEXT(node, sibling) != NULL) if (VSTAILQ_NEXT(node, sibling) != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment