Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1307200
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list |
| Date | 2016-01-12 11:10 +0100 |
| Message-ID | <qQ43N-7TO-73@gated-at.bofh.it> (permalink) |
| References | <qPOBH-5zs-9@gated-at.bofh.it> <qPOBJ-5zs-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 11-01-16, 17:35, Juri Lelli wrote: > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 7dae7f3..d065435 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -969,6 +969,7 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy) > > memcpy(&new_policy, policy, sizeof(*policy)); > > + mutex_lock(&cpufreq_governor_mutex); > /* Update governor of new_policy to the governor used before hotplug */ > gov = find_governor(policy->last_governor); You should take the lock within find_governor() instead, i.e. around the while loop. > if (gov) > @@ -976,6 +977,7 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy) > policy->governor->name, policy->cpu); > else > gov = CPUFREQ_DEFAULT_GOVERNOR; > + mutex_unlock(&cpufreq_governor_mutex); > > new_policy.governor = gov; > > -- > 2.2.2 -- viresh
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list Juri Lelli <juri.lelli@arm.com> - 2016-01-11 18:40 +0100
Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list Viresh Kumar <viresh.kumar@linaro.org> - 2016-01-12 11:10 +0100
Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list Juri Lelli <juri.lelli@arm.com> - 2016-01-12 17:00 +0100
Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list Viresh Kumar <viresh.kumar@linaro.org> - 2016-01-13 07:10 +0100
Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list Juri Lelli <juri.lelli@arm.com> - 2016-01-14 17:40 +0100
csiph-web