Commit b29b8113 authored by Georgi Djakov's avatar Georgi Djakov Committed by Greg Kroah-Hartman

interconnect: qcom: sdm845: Walk the list safely on node removal

As we will remove items off the list using list_del(), we need to use the
safe version of list_for_each_entry().

Fixes: b5d2f741 ("interconnect: qcom: Add sdm845 interconnect provider driver")
Reported-by: default avatarDmitry Osipenko <digetx@gmail.com>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarGeorgi Djakov <georgi.djakov@linaro.org>
Cc: <stable@vger.kernel.org> # v5.3+
Link: https://lore.kernel.org/r/20191212075332.16202-3-georgi.djakov@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e27da6a6
...@@ -868,9 +868,9 @@ static int qnoc_remove(struct platform_device *pdev) ...@@ -868,9 +868,9 @@ static int qnoc_remove(struct platform_device *pdev)
{ {
struct qcom_icc_provider *qp = platform_get_drvdata(pdev); struct qcom_icc_provider *qp = platform_get_drvdata(pdev);
struct icc_provider *provider = &qp->provider; struct icc_provider *provider = &qp->provider;
struct icc_node *n; struct icc_node *n, *tmp;
list_for_each_entry(n, &provider->nodes, node_list) { list_for_each_entry_safe(n, tmp, &provider->nodes, node_list) {
icc_node_del(n); icc_node_del(n);
icc_node_destroy(n->id); icc_node_destroy(n->id);
} }
......
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