Skip to content

Commit

Permalink
[CPUFREQ] Bugfix: Call driver exit in cpufreq_add_dev error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Venkatesh Pallipadi authored and Dave Jones committed Sep 1, 2005
1 parent 6b39374 commit 8085e1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -673,6 +673,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
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);

Expand Down

0 comments on commit 8085e1f

Please sign in to comment.