Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PM / devfreq: Fix kernel panic with cpu based scaling to passive gov

The cpufreq passive register notifier can PROBE_DEFER and the devfreq
struct is freed and then reallocaed on probe retry.
The current logic assume that the code can't PROBE_DEFER so the devfreq
struct in the this variable in devfreq_passive_data is assumed to be
(if already set) always correct.
This cause kernel panic as the code try to access the wrong address.
To correctly handle this, update the this variable in
devfreq_passive_data to the devfreq reallocated struct.

Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor")
Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Christian 'Ansuel' Marangi and committed by
Chanwoo Choi
57e00b40 03c765b0

+1 -2
+1 -2
drivers/devfreq/governor_passive.c
··· 407 407 if (!p_data) 408 408 return -EINVAL; 409 409 410 - if (!p_data->this) 411 - p_data->this = devfreq; 410 + p_data->this = devfreq; 412 411 413 412 switch (event) { 414 413 case DEVFREQ_GOV_START: