Commit 34fce6ca authored by Lino Sanfilippo's avatar Lino Sanfilippo Committed by Jonathan Cameron

io:core: In iio_map_array_register() cleanup in case of error

In function iio_map_array_register() properly rewind in case of error.
Signed-off-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1606571059-13974-2-git-send-email-LinoSanfilippo@gmx.deSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent cc9fb60e
......@@ -60,6 +60,8 @@ int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
i++;
}
error_ret:
if (ret)
iio_map_array_unregister_locked(indio_dev);
mutex_unlock(&iio_map_list_lock);
return ret;
......
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