[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1386264972-5399-76-git-send-email-luis.henriques@canonical.com>
Date: Thu, 5 Dec 2013 17:35:57 +0000
From: Luis Henriques <luis.henriques@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Frank Zago <frank@...o.net>, Jonathan Cameron <jic23@...nel.org>,
Luis Henriques <luis.henriques@...onical.com>
Subject: [PATCH 3.5 75/90] iio:accel:kxsd9 fix missing mutex unlock
3.5.7.27 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Zago <frank@...o.net>
commit 0ee005c7dc2803125275e24598f0fb37775a6af3 upstream.
This will leave a lock held after reading from the device, preventing
any further reads.
Signed-off-by: Frank Zago <frank@...o.net>
Signed-off-by: Jonathan Cameron <jic23@...nel.org>
[ luis: backported to 3.5:
- adjusted context
- drivers/iio/accel/kxsd9.c -> drivers/staging/iio/accel/kxsd9.c ]
Signed-off-by: Luis Henriques <luis.henriques@...onical.com>
---
drivers/staging/iio/accel/kxsd9.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/accel/kxsd9.c b/drivers/staging/iio/accel/kxsd9.c
index 8cf7cd9..cfa77fb 100644
--- a/drivers/staging/iio/accel/kxsd9.c
+++ b/drivers/staging/iio/accel/kxsd9.c
@@ -116,9 +116,10 @@ static int kxsd9_read(struct iio_dev *indio_dev, u8 address)
spi_message_add_tail(&xfers[0], &msg);
spi_message_add_tail(&xfers[1], &msg);
ret = spi_sync(st->us, &msg);
- if (ret)
- return ret;
- return (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
+ if (!ret)
+ ret = (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
+ mutex_unlock(&st->buf_lock);
+ return ret;
}
static IIO_CONST_ATTR(accel_scale_available,
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists