Skip to content

Commit

Permalink
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
Linus Torvalds committed May 20, 2013
2 parents 5e427ec + 917cc4e commit 622f223
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
14 changes: 14 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions drivers/hwmon/abituguru.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 5 additions & 3 deletions drivers/hwmon/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/tmp401.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/*
Expand Down

0 comments on commit 622f223

Please sign in to comment.