diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2016-09-20 10:56:28 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-20 10:59:21 -0400 |
commit | 5372e054a1928fe704cf0a5e2e139645a777b50a (patch) | |
tree | f49d3bbc2ac21e1dc537277eb3a40e9ca37ff654 | |
parent | b067a7be411ccb31b6cc866fc213670c3acf4001 (diff) |
cpufreq: Fix up conversion to hotplug state machine
The function cpufreq_register_driver() returns zero on success and since
commit 27622b061eb4 ("cpufreq: Convert to hotplug state machine")
erroneously a positive number. Due to the "if (x) assume_error" construct
all callers assumed an error and as a consequence the cpu freq kworker
crashes with a NULL pointer dereference.
Reset the return value back to zero in the success case.
Fixes: 27622b061eb4 ("cpufreq: Convert to hotplug state machine")
Reported-by: Borislav Petkov <bp@alien8.de>
Reported-and-tested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: peterz@infradead.org
Cc: rjw@rjwysocki.net
Link: http://lkml.kernel.org/r/20160920145628.lp2bmq72ip3oiash@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index e0bc632a259e..8b44de4d7438 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -2503,6 +2503,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
2503 | if (ret < 0) | 2503 | if (ret < 0) |
2504 | goto err_if_unreg; | 2504 | goto err_if_unreg; |
2505 | hp_online = ret; | 2505 | hp_online = ret; |
2506 | ret = 0; | ||
2506 | 2507 | ||
2507 | pr_debug("driver %s up and running\n", driver_data->name); | 2508 | pr_debug("driver %s up and running\n", driver_data->name); |
2508 | goto out; | 2509 | goto out; |