Re: [PATCH v5] iio: adc: ad4030: fix invalid oversampling_ratio validation
From: Andy Shevchenko
Date: Thu Sep 03 2026 - 08:01:01 EST
On Thu, Sep 03, 2026 at 12:43:09PM +0100, Salah Triki wrote:
> In ad4030_set_avg_frame_len(), the logarithm is calculated before input
> validation. Passing zero or negative values leads to an undefined result
> from ilog2().
>
> Validate that the input is strictly positive prior to computing its
> logarithm.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
...
> Assisted-by: Claude:claude-sonnet-5
Assisted-by: LLM
(Documentation was updated on this. No need to resend just for this, though.)
--
With Best Regards,
Andy Shevchenko