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:
Родитель
f722406faa
Коммит
4510d198f9
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче