Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcf2debc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Bail out when two threads add sparse bindings"

parents 1a60f3f6 e8c82574
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3493,10 +3493,16 @@ static int _sparse_add_to_bind_tree(struct kgsl_mem_entry *entry,
		parent = *node;
		this = rb_entry(parent, struct sparse_bind_object, node);

		if (new->v_off < this->v_off)
		if ((new->v_off < this->v_off) &&
			((new->v_off + new->size) <= this->v_off))
			node = &parent->rb_left;
		else if (new->v_off > this->v_off)
		else if ((new->v_off > this->v_off) &&
			(new->v_off >= (this->v_off + this->size)))
			node = &parent->rb_right;
		else {
			kfree(new);
			return -EADDRINUSE;
		}
	}

	rb_link_node(&new->node, parent, node);