Commit 4510d198 authored by Axel Lin's avatar Axel Lin Committed by Guenter Roeck

hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent f722406f
...@@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev) ...@@ -84,8 +84,10 @@ static int iio_hwmon_probe(struct platform_device *pdev)
return PTR_ERR(channels); return PTR_ERR(channels);
st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL); st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
if (st == NULL) if (st == NULL) {
return -ENOMEM; ret = -ENOMEM;
goto error_release_channels;
}
st->channels = channels; st->channels = channels;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment