提交 8085e1f1 编写于 作者: V Venkatesh Pallipadi 提交者: Dave Jones

[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: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: NDave Jones <davej@redhat.com>
上级 6b39374a
......@@ -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 @@ 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册