linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iio:dac:ad5449: unlock on error path
@ 2012-10-24  7:13 Dan Carpenter
  2012-10-24  8:22 ` Lars-Peter Clausen
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2012-10-24  7:13 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, kernel-janitors

There is an unlock missing on this error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Only needed in linux-next.

diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
index 5b43030..0ee6f8e 100644
--- a/drivers/iio/dac/ad5449.c
+++ b/drivers/iio/dac/ad5449.c
@@ -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,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-05  6:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24  7:13 [patch] iio:dac:ad5449: unlock on error path Dan Carpenter
2012-10-24  8:22 ` Lars-Peter Clausen
2012-11-02 11:06   ` Jonathan Cameron
2012-11-02 16:52     ` walter harms
2012-11-05  6:38       ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).