From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130603221202.711933097@goodmis.org> Date: Mon, 03 Jun 2013 18:11:17 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Yongjun , Guenter Roeck Subject: [61/65] hwmon: fix error return code in abituguru_probe() References: <20130603221016.243553628@goodmis.org> Content-Disposition: inline; filename=0061-hwmon-fix-error-return-code-in-abituguru_probe.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.5 stable review patch. If anyone has any objections, please let me know. ------------------ From: Wei Yongjun [ Upstream commit ecacb0b17c08fae89f65468727f0e4b8e91da4e1 ] 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 Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Steven Rostedt --- drivers/hwmon/abituguru.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c index d4419b4..b13409c 100644 --- a/drivers/hwmon/abituguru.c +++ b/drivers/hwmon/abituguru.c @@ -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)) -- 1.7.10.4