aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-20 14:36:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-20 14:36:52 -0400
commit622f223488517f2b0a5a5e518b2a6c950cf0a2ee (patch)
tree6ee3fcb99e88c3fc8163561444a888ef842b1da9
parent5e427ec2d066b48a5c27b3a5a3315f7e4e729077 (diff)
parent917cc4e6b25c655264e8ea903eb77db25994ac24 (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - Error path fixes for abituguru and iio_hwmon drivers. - Drop erroneously created attributes from nct6775 driver. - Drop redundant safety on cache lifetime for tmp401 driver. - Add explicit maintainer for LM95234 and TMP401 drivers. * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: MAINTAINERS: Add myself as maintainer for LM95234 and TMP401 drivers hwmon: (tmp401) Drop redundant safety on cache lifetime hwmon: fix error return code in abituguru_probe() hwmon: (iio_hwmon) Fix null pointer dereference hwmon: (nct6775) Do not create non-existing attributes hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail
-rw-r--r--MAINTAINERS14
-rw-r--r--drivers/hwmon/abituguru.c16
-rw-r--r--drivers/hwmon/iio_hwmon.c8
-rw-r--r--drivers/hwmon/nct6775.c6
-rw-r--r--drivers/hwmon/tmp401.c2
5 files changed, 34 insertions, 12 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 3a7b07f513da..829c0321108b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4976,6 +4976,13 @@ S: Maintained
4976F: Documentation/hwmon/lm90 4976F: Documentation/hwmon/lm90
4977F: drivers/hwmon/lm90.c 4977F: drivers/hwmon/lm90.c
4978 4978
4979LM95234 HARDWARE MONITOR DRIVER
4980M: Guenter Roeck <linux@roeck-us.net>
4981L: lm-sensors@lm-sensors.org
4982S: Maintained
4983F: Documentation/hwmon/lm95234
4984F: drivers/hwmon/lm95234.c
4985
4979LME2510 MEDIA DRIVER 4986LME2510 MEDIA DRIVER
4980M: Malcolm Priestley <tvboxspy@gmail.com> 4987M: Malcolm Priestley <tvboxspy@gmail.com>
4981L: linux-media@vger.kernel.org 4988L: linux-media@vger.kernel.org
@@ -8182,6 +8189,13 @@ F: drivers/mmc/host/sh_mobile_sdhi.c
8182F: include/linux/mmc/tmio.h 8189F: include/linux/mmc/tmio.h
8183F: include/linux/mmc/sh_mobile_sdhi.h 8190F: include/linux/mmc/sh_mobile_sdhi.h
8184 8191
8192TMP401 HARDWARE MONITOR DRIVER
8193M: Guenter Roeck <linux@roeck-us.net>
8194L: lm-sensors@lm-sensors.org
8195S: Maintained
8196F: Documentation/hwmon/tmp401
8197F: drivers/hwmon/tmp401.c
8198
8185TMPFS (SHMEM FILESYSTEM) 8199TMPFS (SHMEM FILESYSTEM)
8186M: Hugh Dickins <hughd@google.com> 8200M: Hugh Dickins <hughd@google.com>
8187L: linux-mm@kvack.org 8201L: linux-mm@kvack.org
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))
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index aafa4531b961..52b77afebde1 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
84 return PTR_ERR(channels); 84 return PTR_ERR(channels);
85 85
86 st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL); 86 st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
87 if (st == NULL) 87 if (st == NULL) {
88 return -ENOMEM; 88 ret = -ENOMEM;
89 goto error_release_channels;
90 }
89 91
90 st->channels = channels; 92 st->channels = channels;
91 93
@@ -159,7 +161,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
159error_remove_group: 161error_remove_group:
160 sysfs_remove_group(&dev->kobj, &st->attr_group); 162 sysfs_remove_group(&dev->kobj, &st->attr_group);
161error_release_channels: 163error_release_channels:
162 iio_channel_release_all(st->channels); 164 iio_channel_release_all(channels);
163 return ret; 165 return ret;
164} 166}
165 167
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index f43f5e571db9..04638aee9039 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -3705,8 +3705,10 @@ static int nct6775_probe(struct platform_device *pdev)
3705 data->have_temp |= 1 << i; 3705 data->have_temp |= 1 << i;
3706 data->have_temp_fixed |= 1 << i; 3706 data->have_temp_fixed |= 1 << i;
3707 data->reg_temp[0][i] = reg_temp_alternate[i]; 3707 data->reg_temp[0][i] = reg_temp_alternate[i];
3708 data->reg_temp[1][i] = reg_temp_over[i]; 3708 if (i < num_reg_temp) {
3709 data->reg_temp[2][i] = reg_temp_hyst[i]; 3709 data->reg_temp[1][i] = reg_temp_over[i];
3710 data->reg_temp[2][i] = reg_temp_hyst[i];
3711 }
3710 data->temp_src[i] = i + 1; 3712 data->temp_src[i] = i + 1;
3711 continue; 3713 continue;
3712 } 3714 }
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index a478454f690f..dfe6d9527efb 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -240,7 +240,7 @@ static struct tmp401_data *tmp401_update_device(struct device *dev)
240 mutex_lock(&data->update_lock); 240 mutex_lock(&data->update_lock);
241 241
242 next_update = data->last_updated + 242 next_update = data->last_updated +
243 msecs_to_jiffies(data->update_interval) + 1; 243 msecs_to_jiffies(data->update_interval);
244 if (time_after(jiffies, next_update) || !data->valid) { 244 if (time_after(jiffies, next_update) || !data->valid) {
245 if (data->kind != tmp432) { 245 if (data->kind != tmp432) {
246 /* 246 /*