Commit 9cc96967 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Georgi Djakov
Browse files

interconnect: Sanity check that node isn't already on list



Broken interconnect providers might add the same node multiple times or
in multiple providers, which causes strange errors as the provider's
node list is later traversed.

Detect that a node already has an associated provider, complain and
reject the addition of the node, to aid the developer.

Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210625234903.1324755-1-bjorn.andersson@linaro.org


Signed-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
parent 789a39ad
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -959,6 +959,9 @@ EXPORT_SYMBOL_GPL(icc_link_destroy);
 */
void icc_node_add(struct icc_node *node, struct icc_provider *provider)
{
	if (WARN_ON(node->provider))
		return;

	mutex_lock(&icc_lock);

	node->provider = provider;