Re: [PATCH] cpufreq: initialize policy rwsem before sysfs publication
From: Viresh Kumar
Date: Tue Sep 01 2026 - 00:51:16 EST
On 31-08-26, 20:13, Zhongqiu Han wrote:
> On 8/30/2026 11:53 PM, Runyu Xiao wrote:
> > cpufreq_policy_alloc() initializes policy->rwsem after
> > kobject_init_and_add() has created the policy sysfs directory and its
> > default attributes. A sysfs access can therefore reach a policy callback
> > before the semaphore has been initialized.
> >
> > Initialize policy->rwsem before publishing the policy kobject so sysfs
> > callbacks always see an initialized semaphore.
> >
> > Fixes: ad7722dab729 ("cpufreq: create per policy rwsem instead of per CPU cpu_policy_rwsem")
>
> The tag should be 2fc3384dc75b ("cpufreq: Initialize policy->kobj while
> allocating policy").
Right.
--
viresh