mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
iio: dac: adi-axi-dac: add io_mode check
Add safe check to the high bound of the enum values, Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250219-wip-bl-axi-dac-add-enum-check-v1-1-8de9db0b3b1b@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
583350c1d4
commit
25331775b5
|
|
@ -728,6 +728,9 @@ static int axi_dac_bus_set_io_mode(struct iio_backend *back,
|
|||
struct axi_dac_state *st = iio_backend_get_priv(back);
|
||||
int ival, ret;
|
||||
|
||||
if (mode > AD3552R_IO_MODE_QSPI)
|
||||
return -EINVAL;
|
||||
|
||||
guard(mutex)(&st->lock);
|
||||
|
||||
ret = regmap_update_bits(st->regmap, AXI_DAC_CUSTOM_CTRL_REG,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user