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-Tag: v3.10-rc2~2^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4510d198f994bf49f88aa05d55e7a3584cd430a8;p=platform%2Fkernel%2Flinux-3.10.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 aafa453..368497f 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;