RE: [PATCH v6 2/2] iio: dac: ad5706r: Add support for AD5706R DAC
From: Torreno, Alexis Czezar
Date: Fri Apr 10 2026 - 01:00:01 EST
>
> On Fri, Apr 10, 2026 at 09:33:56AM +0800, Alexis Czezar Torreno wrote:
> > Add support for the Analog Devices AD5706R, a 4-channel 16-bit current
> > output digital-to-analog converter with SPI interface.
> >
> > Features:
> > - 4 independent DAC channels
> > - Hardware and software LDAC trigger
> > - Configurable output range
> > - PWM-based LDAC control
> > - Dither and toggle modes
> > - Dynamically configurable SPI speed
>
> Still the same issue...
> After addressing it in full feel free to add
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>
> ...
>
> > +static int ad5706r_regmap_write(void *context, const void *data,
> > +size_t count) {
> > + struct ad5706r_state *st = context;
> > + unsigned int num_bytes, val;
> > + u16 reg;
>
> > + reg = get_unaligned_be16(data);
>
> But this has the similar issue... Validation has to be done before the access.
> (also theoretically possible to have count 0, so even for byte access we have to
> validate the input, strictly speaking)
>
Will move the validation before the "reg = get_unaligned_be16(data);"
I'll also add the validation to regmap_read for the same reason it accesses
void* reg_buf
will send a v7 with your review tag, thanks!