aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-05-13 02:01:43 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-05-13 11:07:13 -0400
commitecacb0b17c08fae89f65468727f0e4b8e91da4e1 (patch)
tree8e95244a88436aa2dec0e32c37f21a9f44b3ca25
parent159c8cddd9259e9379f37f0a69ddcbb01c4e8b77 (diff)
hwmon: fix error return code in abituguru_probe()
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> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/abituguru.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index df0b69987914..2ebd6ce46108 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1414,14 +1414,18 @@ static int abituguru_probe(struct platform_device *pdev)
1414 pr_info("found Abit uGuru\n"); 1414 pr_info("found Abit uGuru\n");
1415 1415
1416 /* Register sysfs hooks */ 1416 /* Register sysfs hooks */
1417 for (i = 0; i < sysfs_attr_i; i++) 1417 for (i = 0; i < sysfs_attr_i; i++) {
1418 if (device_create_file(&pdev->dev, 1418 res = device_create_file(&pdev->dev,
1419 &data->sysfs_attr[i].dev_attr)) 1419 &data->sysfs_attr[i].dev_attr);
1420 if (res)
1420 goto abituguru_probe_error; 1421 goto abituguru_probe_error;
1421 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) 1422 }
1422 if (device_create_file(&pdev->dev, 1423 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) {
1423 &abituguru_sysfs_attr[i].dev_attr)) 1424 res = device_create_file(&pdev->dev,
1425 &abituguru_sysfs_attr[i].dev_attr);
1426 if (res)
1424 goto abituguru_probe_error; 1427 goto abituguru_probe_error;
1428 }
1425 1429
1426 data->hwmon_dev = hwmon_device_register(&pdev->dev); 1430 data->hwmon_dev = hwmon_device_register(&pdev->dev);
1427 if (!IS_ERR(data->hwmon_dev)) 1431 if (!IS_ERR(data->hwmon_dev))