From 4510d198f994bf49f88aa05d55e7a3584cd430a8 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 23 Apr 2013 17:06:43 +0000 Subject: hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail Signed-off-by: Axel Lin Acked-by: Jonathan Cameron Signed-off-by: Guenter Roeck --- drivers/hwmon/iio_hwmon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/hwmon/iio_hwmon.c') 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) 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; -- cgit v1.2.3-55-g7522