iio: adc: stm32-dfsdm: add check on max filter id
authorFabrice Gasnier <fabrice.gasnier@st.com>
Fri, 23 Feb 2018 12:51:00 +0000 (13:51 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 28 Apr 2018 15:17:59 +0000 (16:17 +0100)
commitdfa105b1f602bdd63296ab0abd2c6ec2cb09eb89
treea78e58acee0ddbe081abb08ce169549493914590
parentc620da3ab37eb8794c8f549a99db59286f4ebd3a
iio: adc: stm32-dfsdm: add check on max filter id

reg property should be checked against number of available filters.
BTW, dfsdm->num_fls wasn't used. But it can be used for this purpose.
This prevents using data out of allocated dfsdm->fl_list array.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-dfsdm-adc.c