From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Krzysztof Kozlowski <krzk@kernel.org>, stable@vger.kernel.org
Subject: [PATCH v3 4/8] PM / Domains: Fix unsafe iteration over modified list of domain providers
Date: Wed, 28 Jun 2017 16:56:19 +0200 [thread overview]
Message-ID: <20170628145623.20716-5-krzk@kernel.org> (raw)
In-Reply-To: <20170628145623.20716-1-krzk@kernel.org>
of_genpd_del_provider() iterates over list of domain provides and
removes matching element thus it has to use safe version of list
iteration.
Fixes: aa42240ab254 ("PM / Domains: Add generic OF-based PM domain look-up")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/base/power/domain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index ebbce6ef0850..793f9f7f3f2d 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1783,12 +1783,12 @@ EXPORT_SYMBOL_GPL(of_genpd_add_provider_onecell);
*/
void of_genpd_del_provider(struct device_node *np)
{
- struct of_genpd_provider *cp;
+ struct of_genpd_provider *cp, *tmp;
struct generic_pm_domain *gpd;
mutex_lock(&gpd_list_lock);
mutex_lock(&of_genpd_mutex);
- list_for_each_entry(cp, &of_genpd_providers, link) {
+ list_for_each_entry_safe(cp, tmp, &of_genpd_providers, link) {
if (cp->node == np) {
/*
* For each PM domain associated with the
--
2.11.0
next prev parent reply other threads:[~2017-06-28 14:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 14:56 [PATCH v3 0/8] PM / Domains: Bunch of small improvements and fixes Krzysztof Kozlowski
2017-06-28 14:56 ` [PATCH v3 1/8] PM / Domains: Constify genpd pointer Krzysztof Kozlowski
2017-06-28 14:56 ` [PATCH v3 2/8] PM / Domains: Handle safely genpd_syscore_switch() call on non-genpd device Krzysztof Kozlowski
2017-07-04 13:01 ` Geert Uytterhoeven
2017-07-04 18:10 ` Krzysztof Kozlowski
2017-07-04 18:19 ` Geert Uytterhoeven
2017-07-04 18:36 ` Krzysztof Kozlowski
2017-07-04 19:54 ` Rafael J. Wysocki
2017-07-04 20:05 ` Krzysztof Kozlowski
2017-07-04 20:12 ` Rafael J. Wysocki
2017-07-04 20:20 ` Krzysztof Kozlowski
2017-07-04 20:28 ` Rafael J. Wysocki
2017-06-28 14:56 ` [PATCH v3 3/8] PM / Domains: Fix unsafe iteration over modified list of device links Krzysztof Kozlowski
2017-06-28 14:56 ` Krzysztof Kozlowski [this message]
2017-06-28 14:56 ` [PATCH v3 5/8] PM / Domains: Fix unsafe iteration over modified list of domains Krzysztof Kozlowski
2017-06-28 14:56 ` [PATCH v3 6/8] PM / Domains: Fix missing default_power_down_ok comment Krzysztof Kozlowski
2017-06-28 14:56 ` [PATCH v3 7/8] PM / Domains: Add lockdep asserts for domains list mutex Krzysztof Kozlowski
2017-06-28 14:56 ` [RFC v3 8/8] PM / Domains: Add asserts for PM domain locks Krzysztof Kozlowski
2017-06-28 23:45 ` [PATCH v3 0/8] PM / Domains: Bunch of small improvements and fixes Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170628145623.20716-5-krzk@kernel.org \
--to=krzk@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®