lkml.org 
[lkml]   [2020]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/2] iio:core: In iio_map_array_register() cleanup in case of error.
    Date
    In function iio_map_array_register() properly rewind in case of error.

    Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
    ---
    drivers/iio/inkern.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
    index 39c1d63..fe30bcb 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;
    --
    2.7.4
    \
     
     \ /
      Last update: 2020-10-18 03:15    [W:3.230 / U:0.244 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site