]> Git Repo - linux.git/commitdiff
cpufreq: Fix up conversion to hotplug state machine
authorSebastian Andrzej Siewior <[email protected]>
Tue, 20 Sep 2016 14:56:28 +0000 (16:56 +0200)
committerThomas Gleixner <[email protected]>
Tue, 20 Sep 2016 14:59:21 +0000 (16:59 +0200)
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 <[email protected]>
Reported-and-tested-by: Ingo Molnar <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
drivers/cpufreq/cpufreq.c

index e0bc632a259ea7dc4b61484640b4203e0da55153..8b44de4d7438e55d5143be808995d7fc7a74f6d1 100644 (file)
@@ -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;
This page took 0.06028 seconds and 4 git commands to generate.