interconnect: Sanity check that node isn't already on list
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 25 Jun 2021 23:49:03 +0000 (16:49 -0700)
committerGeorgi Djakov <djakov@kernel.org>
Thu, 22 Jul 2021 07:06:51 +0000 (10:06 +0300)
commit9cc969675dea496b6689f576ddd4d8fd172705c5
tree481c6571896cc90eb43809bec18ad667d12937da
parent789a39ad39bc7ff24fe16f80326a6e38f047f10b
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 <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210625234903.1324755-1-bjorn.andersson@linaro.org
Signed-off-by: Georgi Djakov <djakov@kernel.org>
drivers/interconnect/core.c