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:
parent
f722406faa
commit
4510d198f9
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue