mirror of https://gitee.com/openkylin/linux.git
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: Lino Sanfilippo <LinoSanfilippo@gmx.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/1606571059-13974-2-git-send-email-LinoSanfilippo@gmx.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
cc9fb60eaf
commit
34fce6cadf
|
@ -60,6 +60,8 @@ int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
error_ret:
|
error_ret:
|
||||||
|
if (ret)
|
||||||
|
iio_map_array_unregister_locked(indio_dev);
|
||||||
mutex_unlock(&iio_map_list_lock);
|
mutex_unlock(&iio_map_list_lock);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue