kernel_optimize_test/drivers/iio/imu/inv_mpu6050
Lars-Peter Clausen 5670ed4d55 iio: inv_mpu6050: Fully validate gyro and accel scale writes
commit e09fe9135399807b8397798a53160e055dc6c29f upstream.

When setting the gyro or accelerometer scale the inv_mpu6050 driver ignores
the integer part of the value. As a result e.g. all of 0.13309, 1.13309,
12345.13309, ... are accepted as a valid gyro scale and 0.13309 is the
scale that gets set in all those cases.

Make sure to check that the integer part of the scale value is 0 and reject
it otherwise.

Fixes: 09a642b785 ("Invensense MPU6050 Device Driver.")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20210405114441.24167-1-lars@metafoo.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-14 09:49:58 +02:00
..
inv_mpu_acpi.c iio: imu: inv_mpu6050: Drop double check for ACPI companion device 2020-06-14 11:49:32 +01:00
inv_mpu_aux.c
inv_mpu_aux.h
inv_mpu_core.c iio: inv_mpu6050: Fully validate gyro and accel scale writes 2021-05-14 09:49:58 +02:00
inv_mpu_i2c.c iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:17 +01:00
inv_mpu_iio.h iio:imu:inv_mpu6050 Fix dma and ts alignment and data leak issues. 2020-09-21 20:01:51 +01:00
inv_mpu_magn.c iio: imu: inv_mpu6050: fix data polling interface 2020-03-08 17:28:38 +00:00
inv_mpu_magn.h iio: imu: inv_mpu6050: fix data polling interface 2020-03-08 17:28:38 +00:00
inv_mpu_ring.c iio:imu:inv_mpu6050: Use regmap_noinc_read for fifo reads. 2020-09-21 20:01:51 +01:00
inv_mpu_spi.c iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:18 +01:00
inv_mpu_trigger.c iio: imu: inv_mpu6050: use runtime pm with autosuspend 2020-03-08 17:28:39 +00:00
Kconfig iio: imu: inv_mpu6050: add support of ICM20690 2020-02-14 15:06:25 +00:00
Makefile