]> git.hungrycats.org Git - linux/commitdiff
[PATCH] cpufreq sysfs oops fix
authorAndrew Morton <akpm@osdl.org>
Sun, 5 Oct 2003 04:04:02 +0000 (21:04 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 5 Oct 2003 04:04:02 +0000 (21:04 -0700)
From: Dominik Brodowski <linux@brodo.de>

Fix an ordering problem whcih was causing cpufreq oopses in sysfs.

drivers/cpufreq/cpufreq.c

index 27a22088034062514bfcb3623b81134f5ad67288..25ba41b0f6a7f28c0c1bb8a0c30f8b1470e823c6 100644 (file)
@@ -449,6 +449,9 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
        if (!kobject_get(&data->kobj))
                return -EFAULT;
 
+       if (cpufreq_driver->target)
+               __cpufreq_governor(data, CPUFREQ_GOV_STOP);
+
        kobject_unregister(&data->kobj);
 
        kobject_put(&data->kobj);
@@ -459,9 +462,6 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
         */
        wait_for_completion(&data->kobj_unregister);
 
-       if (cpufreq_driver->target)
-               __cpufreq_governor(data, CPUFREQ_GOV_STOP);
-
        if (cpufreq_driver->exit)
                cpufreq_driver->exit(data);