From: Axel Lin Date: Tue, 23 Apr 2013 17:06:43 +0000 (+0000) Subject: hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4510d198f994bf49f88aa05d55e7a3584cd430a8;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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;