From 3021678a94cdb942bea4e634a37e91fe341b27b0 Mon Sep 17 00:00:00 2001 From: Hartmut Knaack Date: Fri, 17 Jul 2015 10:52:30 +0200 Subject: [PATCH] iio:magnetometer:bmc150_magn: expand mutex in trigger_handler Keep the mutex locked, until the content of data->buffer has been pushed out. Signed-off-by: Hartmut Knaack Acked-by: Irina Tirdea Signed-off-by: Jonathan Cameron --- drivers/iio/magnetometer/bmc150_magn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index 074a99da7367..324412d51cf8 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -664,7 +664,6 @@ static irqreturn_t bmc150_magn_trigger_handler(int irq, void *p) mutex_lock(&data->mutex); ret = bmc150_magn_read_xyz(data, data->buffer); - mutex_unlock(&data->mutex); if (ret < 0) goto err; @@ -672,6 +671,7 @@ static irqreturn_t bmc150_magn_trigger_handler(int irq, void *p) pf->timestamp); err: + mutex_unlock(&data->mutex); iio_trigger_notify_done(indio_dev->trig); return IRQ_HANDLED; -- 2.30.2