Skip to content

Commit 10470de

Browse files
Ivan Kokshayskyvireshk
authored andcommitted
cpufreq: dt: fix oops on armada37xx
Commit 0c86862 (cpufreq: dt: Allow platform specific intermediate callbacks) added two function pointers to the struct cpufreq_dt_platform_data. However, armada37xx_cpufreq_driver_init() has this struct (pdata) located on the stack and uses only "suspend" and "resume" fields. So these newly added "get_intermediate" and "target_intermediate" pointers are uninitialized and contain arbitrary non-null values, causing all kinds of trouble. For instance, here is an oops on espressobin after an attempt to change the cpefreq governor: [ 29.174554] Unable to handle kernel execute from non-executable memory at virtual address ffff00003f87bdc0 ... [ 29.269373] pc : 0xffff00003f87bdc0 [ 29.272957] lr : __cpufreq_driver_target+0x138/0x580 ... Fixed by zeroing out pdata before use. Cc: <[email protected]> # v5.7+ Signed-off-by: Ivan Kokshaysky <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent d48461b commit 10470de

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/cpufreq/armada-37xx-cpufreq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
456456
/* Now that everything is setup, enable the DVFS at hardware level */
457457
armada37xx_cpufreq_enable_dvfs(nb_pm_base);
458458

459+
memset(&pdata, 0, sizeof(pdata));
459460
pdata.suspend = armada37xx_cpufreq_suspend;
460461
pdata.resume = armada37xx_cpufreq_resume;
461462

0 commit comments

Comments
 (0)