From: Venkatesh Pallipadi Date: Thu, 25 Aug 2005 20:14:06 +0000 (-0700) Subject: [CPUFREQ] Bugfix: Call driver exit in cpufreq_add_dev error path X-Git-Tag: v2.6.14-rc1~492^2~16^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8085e1f1f0645fc6ddefcb54fdcba95808df5049;p=linux-2.6 [CPUFREQ] Bugfix: Call driver exit in cpufreq_add_dev error path 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 Signed-off-by: Dave Jones --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 10b0149823..109d62ccf6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -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);