diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2020-11-28 14:44:19 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-12-03 20:40:25 +0100 |
commit | 34fce6cadf3b913fce7104b802110dedbccc5dcc (patch) | |
tree | 45b1b30c1bd85b395a369fd040151c5bf0346570 | |
parent | iio:core: Introduce unlocked version of iio_map_array_unregister() (diff) | |
download | linux-34fce6cadf3b913fce7104b802110dedbccc5dcc.tar.xz linux-34fce6cadf3b913fce7104b802110dedbccc5dcc.zip |
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>
-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; |