]> err.no Git - linux-2.6/commitdiff
[CPUFREQ] Bugfix: Call driver exit in cpufreq_add_dev error path
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Thu, 25 Aug 2005 20:14:06 +0000 (13:14 -0700)
committerDave Jones <davej@redhat.com>
Thu, 1 Sep 2005 05:21:28 +0000 (22:21 -0700)
A minor fix for cpufreq_add_dev() error path. We need to call driver->exit()
if driver_init() call has succeeded.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq.c

index 10b0149823816b60dc4807a95f072142e1df3f42..109d62ccf6514fe5475154ed821c7cb6bbefcbdf 100644 (file)
@@ -627,7 +627,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
 
        ret = kobject_register(&policy->kobj);
        if (ret)
-               goto err_out;
+               goto err_out_driver_exit;
 
        /* set up files for this cpu device */
        drv_attr = cpufreq_driver->attr;
@@ -673,6 +673,10 @@ err_out_unregister:
        kobject_unregister(&policy->kobj);
        wait_for_completion(&policy->kobj_unregister);
 
+err_out_driver_exit:
+       if (cpufreq_driver->exit)
+               cpufreq_driver->exit(policy);
+
 err_out:
        kfree(policy);