Re: [PATCH] media: i2c: imx296: Fix error handling while reading temperature

From: Sakari Ailus
Date: Mon Apr 17 2023 - 06:03:47 EST


Hi Laurent,

On Mon, Apr 17, 2023 at 08:30:59AM +0300, Laurent Pinchart wrote:
> Hi Christophe,
>
> Thank you for the patch.
>
> On Mon, Apr 17, 2023 at 12:14:42AM +0200, Christophe JAILLET wrote:
> > If imx296_read() returns an error, its returned value is a negative value.
> > But because of the "& IMX296_TMDOUT_MASK" (i.e. 0x3ff), 'tmdout' can't be
> > negative.
> >
> > So the error handling does not work as expected and a wrong value is used
> > to compute the temperature.
> >
> > Apply the IMX296_TMDOUT_MASK mask after checking for errors to fix it.
> >
> > Fixes: cb33db2b6ccf ("media: i2c: IMX296 camera sensor driver")
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
>
> Dan Carpenter has submitted the same fix in
> https://lore.kernel.org/linux-media/Y%2FYf19AE78jn5YW7@kili/. Sakari,
> could you please pick it up ?

Oops, thanks for notifying me. This slipped from my hands somehow. It's in
my tree now.

--
Sakari Ailus