diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2020-11-28 16:44:19 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-12-03 22:40:25 +0300 |
commit | 34fce6cadf3b913fce7104b802110dedbccc5dcc (patch) | |
tree | 45b1b30c1bd85b395a369fd040151c5bf0346570 /drivers/iio/inkern.c | |
parent | cc9fb60eaf092be8f7f51a5cbfa23e70edfa453b (diff) | |
download | linux-34fce6cadf3b913fce7104b802110dedbccc5dcc.tar.xz |
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>
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r-- | drivers/iio/inkern.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 39c1d635dc03..fe30bcb6a57b 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -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; |