Thread (3 messages) 3 messages, 3 authors, 2021-03-06
STALE1948d LANDED

[PATCH] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler

From: Dinghao Liu <hidden>
Date: 2021-03-01 08:06:23
Also in: lkml
Subsystem: iio subsystem and drivers, invensense mpu-3050 gyroscope driver, the rest · Maintainers: Jonathan Cameron, Linus Walleij, Linus Torvalds

There is one regmap_bulk_read() call in mpu3050_trigger_handler
that we have caught its return value bug lack further handling.
Check and terminate the execution flow just like the other three
regmap_bulk_read() calls in this function.

Signed-off-by: Dinghao Liu <redacted>
---
 drivers/iio/gyro/mpu3050-core.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index dfa31a23500f..ac90be03332a 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -551,6 +551,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p)
 					       MPU3050_FIFO_R,
 					       &fifo_values[offset],
 					       toread);
+			if (ret)
+				goto out_trigger_unlock;
 
 			dev_dbg(mpu3050->dev,
 				"%04x %04x %04x %04x %04x\n",
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help