Re: [PATCH] iio: gyro: itg3200: Fix unchecked return value in read_raw
From: Jonathan Cameron
Date: Thu Jan 29 2026 - 12:11:35 EST
On Thu, 29 Jan 2026 17:53:22 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Thu, Jan 29, 2026 at 05:01:45PM +0200, Antoniu Miclaus wrote:
> > The return value from itg3200_read_reg_s16() is stored in ret but
> > never checked. The function unconditionally returns IIO_VAL_INT,
> > ignoring potential I2C read failures. This causes garbage data to
> > be returned to userspace when the read fails, with no error reported.
>
> > Add proper error checking to propagate the failure to callers.
>
> Yeah, but when it's not a series do not use --thread!
> (P.S. do not resend, it's for the future now)
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>
Applied this patch to the togreg branch of iio.git (given nearness
of merge window) and marked for stable.