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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRmiYKAAoJEMsfJm/On5mB57IP/0qoOFnDQZ9uYUjMXSkPsWlE
 OBNZrrQDAt5ir0uQdJWJcuzqGolq7i52FTPDUqWRLuHXAEsZh76cYvbh73OCRN/Q
 C2wxFLbZqwm0bdTA/bnlbRKSKKCYiqljWY1kA8ktgzXxzxmaGIf+t+GSy5lCccku
 It2miDn5uB6K+HONIgkLw9r3hVLH6T3epsLxdm2hSOBohgff11uqXklUgKbUdU4S
 zmNthIg2P7gUBA7UbnyzqFZ8T2u2DMhQMEcVH825ouiobcLlR/Int9ed9LA9T7ov
 9I7N3hINF9DDIvOVpnOH8qSgVLve65+LMAZY00drICgjyPnkhxvyxQMlZpinDJj9
 1effe8XQXBRZYxc0QC7wcGr2mf+SMafqBivHJZpwFheSorXxOZ7Eml3JnZb6iqvG
 8qSfMhCPdxTWfHMDKKxPwsyNT8IfJ2GZ1vQi6WPOp+Udsp4fmT1OdyiiEdiJ64F8
 ZMZuBo1oicUyscL2n51njdJ4xGw9+kntf+Ulz8NxTPftKlHRZrnIn80ZW0z7+3Ze
 hAtOgqn3CXViOS8W9zFRZ1faWvCmjzL6qLuQ3SC8GtwG5KURg5Ze2+OvVyBWNOuP
 PzHrRKbhHQjrbRQ9nyYWcM5soAuOxaTAXRP173Hu414YranuVEIhGwfDHIpPUxC5
 QWpTn82Sa+jaGnDh4Etd
 =hhXB
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2013-05-20 11:36:52 -07:00
commit 622f223488
5 changed files with 34 additions and 12 deletions

View File

@ -4976,6 +4976,13 @@ S: Maintained
F: Documentation/hwmon/lm90
F: drivers/hwmon/lm90.c
LM95234 HARDWARE MONITOR DRIVER
M: Guenter Roeck <linux@roeck-us.net>
L: lm-sensors@lm-sensors.org
S: Maintained
F: Documentation/hwmon/lm95234
F: drivers/hwmon/lm95234.c
LME2510 MEDIA DRIVER
M: Malcolm Priestley <tvboxspy@gmail.com>
L: linux-media@vger.kernel.org
@ -8182,6 +8189,13 @@ F: drivers/mmc/host/sh_mobile_sdhi.c
F: include/linux/mmc/tmio.h
F: include/linux/mmc/sh_mobile_sdhi.h
TMP401 HARDWARE MONITOR DRIVER
M: Guenter Roeck <linux@roeck-us.net>
L: lm-sensors@lm-sensors.org
S: Maintained
F: Documentation/hwmon/tmp401
F: drivers/hwmon/tmp401.c
TMPFS (SHMEM FILESYSTEM)
M: Hugh Dickins <hughd@google.com>
L: linux-mm@kvack.org

View File

@ -1414,14 +1414,18 @@ static int 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))

View File

@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
return PTR_ERR(channels);
st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
if (st == NULL)
return -ENOMEM;
if (st == NULL) {
ret = -ENOMEM;
goto error_release_channels;
}
st->channels = channels;
@ -159,7 +161,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
error_remove_group:
sysfs_remove_group(&dev->kobj, &st->attr_group);
error_release_channels:
iio_channel_release_all(st->channels);
iio_channel_release_all(channels);
return ret;
}

View File

@ -3705,8 +3705,10 @@ static int nct6775_probe(struct platform_device *pdev)
data->have_temp |= 1 << i;
data->have_temp_fixed |= 1 << i;
data->reg_temp[0][i] = reg_temp_alternate[i];
data->reg_temp[1][i] = reg_temp_over[i];
data->reg_temp[2][i] = reg_temp_hyst[i];
if (i < num_reg_temp) {
data->reg_temp[1][i] = reg_temp_over[i];
data->reg_temp[2][i] = reg_temp_hyst[i];
}
data->temp_src[i] = i + 1;
continue;
}

View File

@ -240,7 +240,7 @@ static struct tmp401_data *tmp401_update_device(struct device *dev)
mutex_lock(&data->update_lock);
next_update = data->last_updated +
msecs_to_jiffies(data->update_interval) + 1;
msecs_to_jiffies(data->update_interval);
if (time_after(jiffies, next_update) || !data->valid) {
if (data->kind != tmp432) {
/*