linux/drivers/cpufreq
Geert Uytterhoeven 09712f557b cpufreq: Avoid crash in resume on SMP without OPP
When resuming from s2ram on an SMP system without cpufreq operating
points (e.g. there's no "operating-points" property for the CPU node in
DT, or the platform doesn't use DT yet), the kernel crashes when
bringing CPU 1 online:

    Enabling non-boot CPUs ...
    CPU1: Booted secondary processor
    Unable to handle kernel NULL pointer dereference at virtual address 0000003c
    pgd = ee5e6b00
    [0000003c] *pgd=6e579003, *pmd=6e588003, *pte=00000000
    Internal error: Oops: a07 [#1] SMP ARM
    Modules linked in:
    CPU: 0 PID: 1246 Comm: s2ram Tainted: G        W      3.18.0-rc3-koelsch-01614-g0377af242bb175c8-dirty #589
    task: eeec5240 ti: ee704000 task.ti: ee704000
    PC is at __cpufreq_add_dev.isra.24+0x24c/0x77c
    LR is at __cpufreq_add_dev.isra.24+0x244/0x77c
    pc : [<c0298efc>]    lr : [<c0298ef4>]    psr: 60000153
    sp : ee705d48  ip : ee705d48  fp : ee705d84
    r10: c04e0450  r9 : 00000000  r8 : 00000001
    r7 : c05426a8  r6 : 00000001  r5 : 00000001  r4 : 00000000
    r3 : 00000000  r2 : 00000000  r1 : 20000153  r0 : c0542734

Verify that policy is not NULL before dereferencing it to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: 8414809c6a (cpufreq: Preserve policy structure across suspend/resume)
Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-08 02:10:04 +01:00
..
acpi-cpufreq.c
amd_freq_sensitivity.c
arm_big_little_dt.c cpufreq: arm_big_little: fix module license spec 2014-08-09 02:43:33 +02:00
arm_big_little.c cpufreq: arm_big_little: fix module license spec 2014-08-09 02:43:33 +02:00
arm_big_little.h
at32ap-cpufreq.c
blackfin-cpufreq.c
cpufreq_conservative.c
cpufreq_governor.c cpufreq: governor: remove copy_prev_load from 'struct cpu_dbs_common_info' 2014-06-09 12:58:21 +02:00
cpufreq_governor.h cpufreq: governor: remove copy_prev_load from 'struct cpu_dbs_common_info' 2014-06-09 12:58:21 +02:00
cpufreq_ondemand.c cpufreq: ondemand: Eliminate the deadband effect 2014-07-21 13:43:19 +02:00
cpufreq_opp.c cpufreq / OPP: Fix the order of arguments for kcalloc() 2014-09-08 00:02:58 +02:00
cpufreq_performance.c
cpufreq_powersave.c
cpufreq_stats.c
cpufreq_userspace.c
cpufreq-dt.c cpufreq: cpufreq-dt: Fix arguments in clock failure error message 2014-11-05 20:51:21 +01:00
cpufreq-nforce2.c
cpufreq.c cpufreq: Avoid crash in resume on SMP without OPP 2014-11-08 02:10:04 +01:00
cris-artpec3-cpufreq.c
cris-etraxfs-cpufreq.c
davinci-cpufreq.c
dbx500-cpufreq.c
e_powersaver.c
elanfreq.c
exynos4x12-cpufreq.c cpufreq: cpu0: rename driver and internals to 'cpufreq_dt' 2014-10-03 15:37:54 +02:00
exynos4210-cpufreq.c cpufreq: cpu0: rename driver and internals to 'cpufreq_dt' 2014-10-03 15:37:54 +02:00
exynos5250-cpufreq.c cpufreq: cpu0: rename driver and internals to 'cpufreq_dt' 2014-10-03 15:37:54 +02:00
exynos5440-cpufreq.c
exynos-cpufreq.c
exynos-cpufreq.h
freq_table.c cpufreq: Introduce new relation for freq selection 2014-07-21 13:43:19 +02:00
gx-suspmod.c
highbank-cpufreq.c Merge branch 'mailbox-for-linus' of git://git.linaro.org/landing-teams/working/fujitsu/integration 2014-10-21 11:21:19 -07:00
ia64-acpi-cpufreq.c
imx6q-cpufreq.c cpufreq: imx6: remove pu regulator dependency for SOCs with no PU regulator 2014-07-21 13:43:19 +02:00
integrator-cpufreq.c cpufreq: integrator: fix integrator_cpufreq_remove return type 2014-09-29 15:36:03 +02:00
intel_pstate.c intel_pstate: Correct BYT VID values. 2014-10-23 23:00:00 +02:00
Kconfig cpufreq: cpu0: rename driver and internals to 'cpufreq_dt' 2014-10-03 15:37:54 +02:00
Kconfig.arm ACPI and power management updates for 3.18-rc1 2014-10-09 16:07:43 -04:00
Kconfig.powerpc
Kconfig.x86
kirkwood-cpufreq.c cpufreq: kirkwood: use the powersave multiplexer 2014-09-02 15:02:54 -07:00
longhaul.c
longhaul.h
longrun.c
loongson2_cpufreq.c MIPS: Loongson: Modify ChipConfig register definition 2014-07-30 21:46:00 +02:00
Makefile cpufreq: cpu0: rename driver and internals to 'cpufreq_dt' 2014-10-03 15:37:54 +02:00
maple-cpufreq.c
omap-cpufreq.c
p4-clockmod.c
pasemi-cpufreq.c
pcc-cpufreq.c cpufreq: pcc-cpufreq: Fix wait_event() under spinlock 2014-09-29 15:35:50 +02:00
pmac32-cpufreq.c powerpc: Remove powerpc specific cmd_line 2014-10-02 17:33:55 +10:00
pmac64-cpufreq.c of: Migrate of_find_node_by_name() users to for_each_node_by_name() 2014-06-26 17:12:24 +01:00
powernow-k6.c powernow-k6: support 350MHz CPU 2014-07-21 13:43:19 +02:00
powernow-k7.c
powernow-k7.h
powernow-k8.c
powernow-k8.h
powernv-cpufreq.c cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec 2014-09-29 15:53:04 +02:00
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c
ppc_cbe_cpufreq.c
ppc_cbe_cpufreq.h
ppc-corenet-cpufreq.c cpufreq: ppc-corenet: remove duplicate update of cpu_data 2014-09-30 21:09:40 +02:00
pxa2xx-cpufreq.c
pxa3xx-cpufreq.c
s3c24xx-cpufreq-debugfs.c
s3c24xx-cpufreq.c cpufreq: s3c24xx: Remove some dead code 2014-07-19 04:24:59 +09:00
s3c64xx-cpufreq.c
s3c2410-cpufreq.c cpufreq: s3c24xx: Remove some dead code 2014-07-19 04:24:59 +09:00
s3c2412-cpufreq.c cpufreq: s3c24xx: Remove some dead code 2014-07-19 04:24:59 +09:00
s3c2416-cpufreq.c
s3c2440-cpufreq.c cpufreq: s3c24xx: Remove some dead code 2014-07-19 04:24:59 +09:00
s5pv210-cpufreq.c cpufreq: cpu0: rename driver and internals to 'cpufreq_dt' 2014-10-03 15:37:54 +02:00
sa1100-cpufreq.c
sa1110-cpufreq.c cpufreq: sa1110: set memory type for h3600 2014-07-16 14:30:17 +02:00
sc520_freq.c
sh-cpufreq.c
sparc-us2e-cpufreq.c
sparc-us3-cpufreq.c
spear-cpufreq.c
speedstep-centrino.c
speedstep-ich.c
speedstep-lib.c
speedstep-lib.h
speedstep-smi.c cpufreq: speedstep-smi: fix decimal printf specifiers 2014-08-07 21:21:52 +02:00
tegra-cpufreq.c cpufreq: tegra: update comment for clarity 2014-06-10 22:50:50 +02:00
unicore2-cpufreq.c
vexpress-spc-cpufreq.c