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>
This commit is contained in:
Axel Lin 2013-04-23 17:06:43 +00:00 committed by Guenter Roeck
parent f722406faa
commit 4510d198f9
1 changed files with 4 additions and 2 deletions

View File

@ -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;