Commit c8c0484f authored by Schspa Shi's avatar Schspa Shi Committed by Jinjie Ruan
Browse files

cpufreq: Abort show()/store() for half-initialized policies

mainline inclusion
from mainline-v5.19-rc1
commit d4627a28
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8EI9L
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4627a287e251efed59f2b4bda82c5950768c963



--------------------------------

If policy initialization fails after the sysfs files are created,
there is a possibility to end up running show()/store() callbacks
for half-initialized policies, which may have unpredictable
outcomes.

Abort show()/store() in such a case by making sure the policy is active.

Also dectivate the policy on such failures.

Signed-off-by: default avatarSchspa Shi <schspa@gmail.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
[ rjw: Subject and changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>

Conflicts:
	drivers/cpufreq/cpufreq.c

Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent 41bf10fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment