Skip to content

Commit

Permalink
[CPUFREQ] Fix sysfs_create_file return value handling
Browse files Browse the repository at this point in the history
Commit 0a4b2cc in cpufreq.git
eliminates the build warnings but does not pass on the error code of
sysfs_create_file to the function calling cpufreq_add_dev. Instead some
previous value of ret would be returned.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Tobias Klauser authored and Dave Jones committed Jun 21, 2007
1 parent ea48761 commit 58a7295
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,16 +826,19 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
if (sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)))
ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
if (ret)
goto err_out_driver_exit;
drv_attr++;
}
if (cpufreq_driver->get){
if (sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr))
ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
if (ret)
goto err_out_driver_exit;
}
if (cpufreq_driver->target){
if (sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr))
ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
if (ret)
goto err_out_driver_exit;
}

Expand Down

0 comments on commit 58a7295

Please sign in to comment.