[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151030120450.GH7289@mwanda>
Date: Fri, 30 Oct 2015 15:04:50 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Rafael Wysocki <rjw@...ysocki.net>, mturquette@...libre.com,
linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Dmitry Torokhov <dtor@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Len Brown <len.brown@...el.com>,
open list <linux-kernel@...r.kernel.org>,
Nishanth Menon <nm@...com>, Pavel Machek <pavel@....cz>,
Stephen Boyd <sboyd@...eaurora.org>
Subject: Re: [PATCH] PM / OPP: Protect updates to list_dev with mutex
On Fri, Oct 30, 2015 at 05:26:06PM +0530, Viresh Kumar wrote:
> --- a/drivers/base/power/opp/cpu.c
> +++ b/drivers/base/power/opp/cpu.c
> @@ -124,12 +124,12 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask)
> struct device *dev;
> int cpu, ret = 0;
>
> - rcu_read_lock();
> + mutex_lock(&dev_opp_list_lock);
>
> dev_opp = _find_device_opp(cpu_dev);
> if (IS_ERR(dev_opp)) {
> ret = -EINVAL;
> - goto out_rcu_read_unlock;
> + goto unlock;
> }
>
> for_each_cpu(cpu, cpumask) {
> @@ -150,8 +150,8 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask)
> continue;
> }
> }
> -out_rcu_read_unlock:
> - rcu_read_unlock();
> +unlock:
> + mutex_unlock(&dev_opp_list_lock);
>
> return 0;
Not introduced by your patch, but this should be "return ret;"
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists