Skip to content

Commit

Permalink
iio:dac:ad5449: unlock on error path
Browse files Browse the repository at this point in the history
There is an unlock missing on this error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jonathan Cameron committed Oct 31, 2012
1 parent 6b3aa31 commit 0c88d23
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/iio/dac/ad5449.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,

ret = spi_sync(st->spi, &msg);
if (ret < 0)
return ret;
goto out_unlock;

*val = be16_to_cpu(st->data[1]);
mutex_unlock(&indio_dev->mlock);

return 0;
out_unlock:
mutex_unlock(&indio_dev->mlock);
return ret;
}

static int ad5449_read_raw(struct iio_dev *indio_dev,
Expand Down

0 comments on commit 0c88d23

Please sign in to comment.