Skip to content

Commit

Permalink
iio: double unlock on error path
Browse files Browse the repository at this point in the history
We should be holding the mutex when we goto error_free_chans.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jonathan Cameron committed Jul 12, 2012
1 parent 21fa54e commit e59b9af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/iio/inkern.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ struct iio_channel *iio_channel_get_all(const char *name)
iio_device_get(chans[mapind].indio_dev);
mapind++;
}
mutex_unlock(&iio_map_list_lock);
if (mapind == 0) {
ret = -ENODEV;
goto error_free_chans;
}
mutex_unlock(&iio_map_list_lock);

return chans;

error_free_chans:
Expand Down

0 comments on commit e59b9af

Please sign in to comment.