[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFqcG+9NCed0HG8AU6p7nZ=jTs64icGqk2ffVHbaKVFz3w@mail.gmail.com>
Date: Tue, 13 Jun 2017 12:38:58 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Kevin Hilman <khilman@...nel.org>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"# 4.0+" <stable@...r.kernel.org>
Subject: Re: [PATCH v2 5/8] PM / Domains: Fix unsafe iteration over modified
list of domain providers
On 12 June 2017 at 17:17, Krzysztof Kozlowski <krzk@...nel.org> wrote:
> 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@...r.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
Acked-by: Ulf Hansson <ulf.hansson@...aro.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 d1e438024e46..b74b5111957a 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1789,12 +1789,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.9.3
>
Powered by blists - more mailing lists