mbox series

[0/2] iio: adc: ad4695: fix out of bounds array access

Message ID 20250218-iio-adc-ad4695-fix-out-of-bounds-array-access-v1-0-57fef8c7a3fd@baylibre.com (mailing list archive)
Headers show
Series iio: adc: ad4695: fix out of bounds array access | expand

Message

David Lechner Feb. 18, 2025, 11:17 p.m. UTC
I was doing some more testing and found a bug with the
in_temp_sampling_frequency attribute being corrupted. This is a patch
to fix that, plus a bonus patch that cleans up some related code (it
wasn't strictly part of the fix, hence the separate patch).

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
David Lechner (2):
      iio: adc: ad4695: fix out of bounds array access
      iio: adc: ad4695: simplify getting oversampling_ratio

 drivers/iio/adc/ad4695.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)
---
base-commit: ac856912f210bcff6a1cf8cf9cb2f6a1dfe85798
change-id: 20250218-iio-adc-ad4695-fix-out-of-bounds-array-access-7f16ebc3be14

Best regards,

Comments

Trevor Gamblin Feb. 19, 2025, 1:09 a.m. UTC | #1
On 2025-02-18 18:17, David Lechner wrote:
> I was doing some more testing and found a bug with the
> in_temp_sampling_frequency attribute being corrupted. This is a patch
> to fix that, plus a bonus patch that cleans up some related code (it
> wasn't strictly part of the fix, hence the separate patch).
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com>
> ---
> David Lechner (2):
>        iio: adc: ad4695: fix out of bounds array access
>        iio: adc: ad4695: simplify getting oversampling_ratio
>
>   drivers/iio/adc/ad4695.c | 26 ++++++++++++++++++++------
>   1 file changed, 20 insertions(+), 6 deletions(-)
> ---
> base-commit: ac856912f210bcff6a1cf8cf9cb2f6a1dfe85798
> change-id: 20250218-iio-adc-ad4695-fix-out-of-bounds-array-access-7f16ebc3be14
>
> Best regards,
Nuno Sá Feb. 19, 2025, 10:25 a.m. UTC | #2
On Tue, 2025-02-18 at 17:17 -0600, David Lechner wrote:
> I was doing some more testing and found a bug with the
> in_temp_sampling_frequency attribute being corrupted. This is a patch
> to fix that, plus a bonus patch that cleans up some related code (it
> wasn't strictly part of the fix, hence the separate patch).
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---

Reviewed-by: Nuno Sá <nuno.sa@analog.com>

> David Lechner (2):
>       iio: adc: ad4695: fix out of bounds array access
>       iio: adc: ad4695: simplify getting oversampling_ratio
> 
>  drivers/iio/adc/ad4695.c | 26 ++++++++++++++++++++------
>  1 file changed, 20 insertions(+), 6 deletions(-)
> ---
> base-commit: ac856912f210bcff6a1cf8cf9cb2f6a1dfe85798
> change-id: 20250218-iio-adc-ad4695-fix-out-of-bounds-array-access-7f16ebc3be14
> 
> Best regards,