Skip to content

Commit 9cc9696

Browse files
anderssonGeorgi Djakov
authored andcommitted
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: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent 789a39a commit 9cc9696

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/interconnect/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,9 @@ EXPORT_SYMBOL_GPL(icc_link_destroy);
959959
*/
960960
void icc_node_add(struct icc_node *node, struct icc_provider *provider)
961961
{
962+
if (WARN_ON(node->provider))
963+
return;
964+
962965
mutex_lock(&icc_lock);
963966

964967
node->provider = provider;

0 commit comments

Comments
 (0)