summaryrefslogtreecommitdiff
path: root/drivers/hwmon/iio_hwmon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-20 11:36:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-20 11:36:52 -0700
commit622f223488517f2b0a5a5e518b2a6c950cf0a2ee (patch)
tree6ee3fcb99e88c3fc8163561444a888ef842b1da9 /drivers/hwmon/iio_hwmon.c
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
Diffstat (limited to 'drivers/hwmon/iio_hwmon.c')
-rw-r--r--drivers/hwmon/iio_hwmon.c8
1 files changed, 5 insertions, 3 deletions
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)
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;
}