]> git.baikalelectronics.ru Git - kernel.git/commit
iio: ssp_sensors: add more range checking in ssp_parse_dataframe()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 9 Sep 2021 09:13:36 +0000 (12:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:15 +0000 (11:40 +0200)
commit4fac2ddbaad3514c2d4098c7027357b6be2d5b57
tree34d4a106c7e967490e3ee6b90aa54427b2decb24
parent9360c607d82861c7dc8cca66226dd8a14d0e7038
iio: ssp_sensors: add more range checking in ssp_parse_dataframe()

commit 8167c9a375ccceed19048ad9d68cb2d02ed276e0 upstream.

The "idx" is validated at the start of the loop but it gets incremented
during the iteration so it needs to be checked again.

Fixes: 2d08e61eaf01 ("iio: common: ssp_sensors: Add sensorhub driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210909091336.GA26312@kili
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/common/ssp_sensors/ssp_spi.c