linux-stable/drivers/cpufreq
Colin Ian King 932e130e3d cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()
commit 943bdd0cec upstream.

Currently there is an unlikely case where cpufreq_cpu_get() returns a
NULL policy and this will cause a NULL pointer dereference later on.

Fix this by passing the policy to transition_frequency_fidvid() from
the caller and hence eliminating the need for the cpufreq_cpu_get()
and cpufreq_cpu_put().

Thanks to Viresh Kumar for suggesting the fix.

Addresses-Coverity: ("Dereference null return")
Fixes: b43a7ffbf3 ("cpufreq: Notify all policy->cpus in cpufreq_notify_transition()")
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-17 14:17:00 +01:00
..
acpi-cpufreq.c acpi-cpufreq: Honor _PSD table setting on new AMD CPUs 2020-10-19 17:28:43 +02:00
amd_freq_sensitivity.c cpufreq: amd_freq_sensitivity: Mark sometimes used ID structs as __maybe_unused 2020-07-15 15:17:06 +02:00
armada-8k-cpufreq.c cpufreq: ap806: Add missing MODULE_DEVICE_TABLE 2020-12-30 11:53:37 +01:00
armada-37xx-cpufreq.c cpufreq: armada-37xx: Add missing MODULE_DEVICE_TABLE 2020-09-16 14:12:18 +05:30
bmips-cpufreq.c cpufreq: Make cpufreq_generic_init() return void 2019-07-16 10:20:11 +02:00
brcmstb-avs-cpufreq.c cpufreq: brcmstb-avs-cpufreq: send S2_ENTER / S2_EXIT commands to AVS 2020-07-30 10:57:44 +05:30
cppc_cpufreq.c cpufreq: CPPC: Reuse caps variable in few routines 2020-07-30 10:57:47 +05:30
cpufreq-dt-platdev.c cpufreq: dt-platdev: Blacklist st,stih418 SoC 2020-09-16 14:12:18 +05:30
cpufreq-dt.c Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm 2020-10-06 12:26:45 +02:00
cpufreq-dt.h cpufreq: dt: Allow platform specific intermediate callbacks 2020-03-12 15:43:52 +05:30
cpufreq-nforce2.c cpufreq: Avoid creating excessively large stack frames 2020-01-27 10:33:33 +01:00
cpufreq.c cpufreq: Add strict_target to struct cpufreq_policy 2020-11-10 18:31:17 +01:00
cpufreq_conservative.c cpufreq: Register governors at core_initcall 2020-07-02 13:03:30 +02:00
cpufreq_governor.c cpufreq: cpufreq_governor: Demote store_sampling_rate() header to standard comment block 2020-07-15 15:17:06 +02:00
cpufreq_governor.h cpufreq: Introduce governor flags 2020-11-10 18:31:17 +01:00
cpufreq_governor_attr_set.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpufreq_ondemand.c cpufreq: Register governors at core_initcall 2020-07-02 13:03:30 +02:00
cpufreq_ondemand.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpufreq_performance.c cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET 2020-11-10 18:31:17 +01:00
cpufreq_powersave.c cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET 2020-11-10 18:31:17 +01:00
cpufreq_stats.c cpufreq: stats: Fix string format specifier mismatch 2020-10-12 12:32:10 +02:00
cpufreq_userspace.c cpufreq: Register governors at core_initcall 2020-07-02 13:03:30 +02:00
davinci-cpufreq.c cpufreq: Replace HTTP links with HTTPS ones 2020-07-13 17:54:37 +02:00
e_powersaver.c cpufreq: e_powersaver: remove unreachable break 2020-10-27 18:42:54 +01:00
elanfreq.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
freq_table.c cpufreq: freq_table: Demote obvious misuse of kerneldoc to standard comment blocks 2020-07-15 15:17:06 +02:00
gx-suspmod.c cpufreq: Avoid creating excessively large stack frames 2020-01-27 10:33:33 +01:00
highbank-cpufreq.c cpufreq: highbank: Add missing MODULE_DEVICE_TABLE 2020-12-30 11:53:38 +01:00
ia64-acpi-cpufreq.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
imx-cpufreq-dt.c cpufreq: imx-cpufreq-dt: support i.MX7ULP 2020-04-28 14:26:20 +05:30
imx6q-cpufreq.c cpufreq: imx6q: Unconditionally call dev_pm_opp_of_remove_table() 2020-09-10 16:36:09 +05:30
intel_pstate.c cpufreq: intel_pstate: Use most recent guaranteed performance values 2020-12-30 11:54:10 +01:00
Kconfig cpufreq: Avoid configuring old governors as default with intel_pstate 2020-10-27 18:45:34 +01:00
Kconfig.arm cpufreq: imx: fix NVMEM_IMX_OCOTP dependency 2020-12-30 11:53:39 +01:00
Kconfig.powerpc cpufreq: Fix Kconfig indentation 2019-11-29 11:52:02 +01:00
Kconfig.x86 treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
kirkwood-cpufreq.c cpufreq: kirkwood: convert to devm_platform_ioremap_resource 2020-01-07 13:29:58 +05:30
longhaul.c cpufreq: e_powersaver: remove unreachable break 2020-10-27 18:42:54 +01:00
longhaul.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
longrun.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
loongson1-cpufreq.c cpufreq: loongson1: Add missing MODULE_ALIAS 2020-12-30 11:53:38 +01:00
loongson2_cpufreq.c mips: loongsoon2ef: remove private clk api 2020-04-16 17:34:23 +02:00
Makefile Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm 2020-08-04 12:44:53 +02:00
maple-cpufreq.c Merge branch 'pm-cpufreq' 2019-07-18 09:49:30 +02:00
mediatek-cpufreq.c cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE 2020-12-30 11:53:38 +01:00
mvebu-cpufreq.c
omap-cpufreq.c OPP: refactor dev_pm_opp_of_register_em() and update related drivers 2020-06-24 17:16:42 +02:00
p4-clockmod.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
pasemi-cpufreq.c cpufreq: pasemi: Include header file for {check,restore}_astate prototypes 2020-07-15 15:17:06 +02:00
pcc-cpufreq.c cpufreq: pcc-cpufreq: Mark sometimes used ID structs as __maybe_unused 2020-07-15 15:17:06 +02:00
pmac32-cpufreq.c Merge branch 'pm-cpufreq' 2019-07-18 09:49:30 +02:00
pmac64-cpufreq.c Merge branch 'pm-cpufreq' 2019-07-18 09:49:30 +02:00
powernow-k6.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
powernow-k7.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
powernow-k7.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
powernow-k8.c cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get() 2021-01-17 14:17:00 +01:00
powernow-k8.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 347 2019-06-05 17:37:08 +02:00
powernv-cpufreq.c cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier 2020-10-08 21:17:16 +11:00
ppc_cbe_cpufreq.c cpufreq: powerpc_cbe: Switch to QoS requests for freq limits 2019-08-26 10:02:01 +02:00
ppc_cbe_cpufreq.h cpufreq: powerpc_cbe: Switch to QoS requests for freq limits 2019-08-26 10:02:01 +02:00
ppc_cbe_cpufreq_pervasive.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 153 2019-05-30 11:26:32 -07:00
ppc_cbe_cpufreq_pmi.c cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
pxa2xx-cpufreq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pxa3xx-cpufreq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
qcom-cpufreq-hw.c Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm 2020-10-06 12:26:45 +02:00
qcom-cpufreq-nvmem.c cpufreq: qcom: Add missing MODULE_DEVICE_TABLE 2020-12-30 11:53:38 +01:00
qoriq-cpufreq.c cpufreq: qoriq: convert to a platform driver 2020-05-07 10:47:27 +05:30
raspberrypi-cpufreq.c cpufreq: add driver for Raspberry Pi 2019-06-13 08:58:22 +05:30
s3c24xx-cpufreq-debugfs.c ARM: s3c: remove cpufreq header dependencies 2020-08-20 17:52:05 +02:00
s3c24xx-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s3c64xx-cpufreq.c cpufreq: s3c64xx: Remove pointless NULL check in s3c64xx_cpufreq_driver_init 2019-10-23 08:53:23 +05:30
s3c2410-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s3c2412-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s3c2416-cpufreq.c cpufreq: s3c: fix unbalances of cpufreq policy refcount 2020-01-07 13:31:01 +05:30
s3c2440-cpufreq.c cpufreq: s3c24xx: move low-level clk reg access into platform code 2020-08-20 17:53:22 +02:00
s5pv210-cpufreq.c cpufreq: s5pv210: Use dev_err instead of pr_err in probe 2020-09-16 14:12:18 +05:30
sa1100-cpufreq.c cpufreq: Make cpufreq_generic_init() return void 2019-07-16 10:20:11 +02:00
sa1110-cpufreq.c Merge branch 'pm-cpufreq' 2019-07-18 09:49:30 +02:00
sc520_freq.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
scmi-cpufreq.c cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK 2020-11-23 10:15:56 +05:30
scpi-cpufreq.c cpufreq: scpi: Add missing MODULE_ALIAS 2020-12-30 11:53:38 +01:00
sfi-cpufreq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 235 2019-06-19 17:09:07 +02:00
sh-cpufreq.c cpufreq: Avoid creating excessively large stack frames 2020-01-27 10:33:33 +01:00
sparc-us2e-cpufreq.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
sparc-us3-cpufreq.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
spear-cpufreq.c cpufreq: Make cpufreq_generic_init() return void 2019-07-16 10:20:11 +02:00
speedstep-centrino.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
speedstep-ich.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
speedstep-lib.c cpufreq: speedstep: remove unneeded semicolon 2020-10-28 18:04:07 +01:00
speedstep-lib.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
speedstep-smi.c cpufreq: Convert to new X86 CPU match macros 2020-03-24 21:31:27 +01:00
sti-cpufreq.c cpufreq: st: Add missing MODULE_DEVICE_TABLE 2020-12-30 11:53:38 +01:00
sun50i-cpufreq-nvmem.c cpufreq: sun50i: Add missing MODULE_DEVICE_TABLE 2020-12-30 11:53:38 +01:00
tango-cpufreq.c
tegra20-cpufreq.c cpufreq: tegra20: Use generic cpufreq-dt driver (Tegra30 supported now) 2020-05-06 18:59:38 +02:00
tegra124-cpufreq.c cpufreq: tegra124: Add suspend and resume support 2019-10-29 13:25:29 +01:00
tegra186-cpufreq.c cpufreq: tegra186: Fix get frequency callback 2020-11-17 10:04:21 +05:30
tegra194-cpufreq.c cpufreq: replace cpu_logical_map() with read_cpuid_mpir() 2020-08-21 20:17:01 +02:00
ti-cpufreq.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
vexpress-spc-cpufreq.c cpufreq: vexpress-spc: Add missing MODULE_ALIAS 2020-12-30 11:53:38 +01:00