There's no point in pushing data to IIO buffers in case 'spi_sync()' fails. Signed-off-by: Nuno Sa <nuno.sa@xxxxxxxxxx> --- drivers/iio/imu/adis_buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c index 0ae551a748eb..a29d22f657ce 100644 --- a/drivers/iio/imu/adis_buffer.c +++ b/drivers/iio/imu/adis_buffer.c @@ -144,9 +144,12 @@ static irqreturn_t adis_trigger_handler(int irq, void *p) } ret = spi_sync(adis->spi, &adis->msg); - if (ret) + if (ret) { dev_err(&adis->spi->dev, "Failed to read data: %d", ret); - + if (adis->data->has_paging) + mutex_unlock(&adis->state_lock); + goto irq_done; + } if (adis->data->has_paging) { adis->current_page = 0; -- 2.31.1