hwmon: fix error return code in abituguru_probe()

commit ecacb0b17c upstream.

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Wei Yongjun 2013-05-13 14:01:43 +08:00 committed by Greg Kroah-Hartman
parent 462e873c64
commit 0e293f0955
1 changed files with 10 additions and 6 deletions

View File

@ -1410,14 +1410,18 @@ static int __devinit abituguru_probe(struct platform_device *pdev)
pr_info("found Abit uGuru\n");
/* Register sysfs hooks */
for (i = 0; i < sysfs_attr_i; i++)
if (device_create_file(&pdev->dev,
&data->sysfs_attr[i].dev_attr))
for (i = 0; i < sysfs_attr_i; i++) {
res = device_create_file(&pdev->dev,
&data->sysfs_attr[i].dev_attr);
if (res)
goto abituguru_probe_error;
for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
if (device_create_file(&pdev->dev,
&abituguru_sysfs_attr[i].dev_attr))
}
for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) {
res = device_create_file(&pdev->dev,
&abituguru_sysfs_attr[i].dev_attr);
if (res)
goto abituguru_probe_error;
}
data->hwmon_dev = hwmon_device_register(&pdev->dev);
if (!IS_ERR(data->hwmon_dev))