aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-04-23 13:06:43 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-05-12 01:55:07 -0400
commit4510d198f994bf49f88aa05d55e7a3584cd430a8 (patch)
treeaab806f5d829294f1d3a21b30374b2e0be138375
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/iio_hwmon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index aafa4531b961..368497fa2627 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