* [PATCH] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler
@ 2021-03-01 8:04 Dinghao Liu
2021-03-02 15:45 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Dinghao Liu @ 2021-03-01 8:04 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Linus Walleij, Jonathan Cameron, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio, linux-kernel
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 <dinghao.liu@zju.edu.cn>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler
2021-03-01 8:04 [PATCH] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler Dinghao Liu
@ 2021-03-02 15:45 ` Linus Walleij
2021-03-06 17:16 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2021-03-02 15:45 UTC (permalink / raw)
To: Dinghao Liu
Cc: Kangjie Lu, Jonathan Cameron, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio, linux-kernel
On Mon, Mar 1, 2021 at 9:04 AM Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
> 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 <dinghao.liu@zju.edu.cn>
OK that makes sense.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler
2021-03-02 15:45 ` Linus Walleij
@ 2021-03-06 17:16 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2021-03-06 17:16 UTC (permalink / raw)
To: Linus Walleij
Cc: Dinghao Liu, Kangjie Lu, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio, linux-kernel
On Tue, 2 Mar 2021 16:45:10 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Mar 1, 2021 at 9:04 AM Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
>
> > 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 <dinghao.liu@zju.edu.cn>
>
> OK that makes sense.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Applied with a fixes tag (it goes all the way back) and marked
for stable.
Thanks,
Jonathan
>
> Yours,
> Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-06 17:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 8:04 [PATCH] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler Dinghao Liu
2021-03-02 15:45 ` Linus Walleij
2021-03-06 17:16 ` Jonathan Cameron
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).