Commit 5372e054 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Thomas Gleixner
Browse files

cpufreq: Fix up conversion to hotplug state machine

The function cpufreq_register_driver() returns zero on success and since
commit 27622b06 ("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: 27622b06

 ("cpufreq: Convert to hotplug state machine")
Reported-by: default avatarBorislav Petkov <>
Reported-and-tested-by: default avatarIngo Molnar <>
Signed-off-by: default avatarSebastian Andrzej Siewior <>

Signed-off-by: default avatarThomas Gleixner <>
parent b067a7be
......@@ -2503,6 +2503,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
if (ret < 0)
goto err_if_unreg;
hp_online = ret;
ret = 0;
pr_debug("driver %s up and running\n", driver_data->name);
goto out;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment