[PATCH 3.15 19/42] iio:bma180: Missing check for frequency fractional part
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2014-08-05 18:50:06
Also in:
lkml
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2014-08-05 18:50:06
Also in:
lkml
3.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Meerwald <redacted> commit 9b2a4d35a6ceaf217be61ed8eb3c16986244f640 upstream. val2 should be zero This will make no difference for correct inputs but will reject incorrect ones with a decimal part in the value written to the sysfs interface. Signed-off-by: Peter Meerwald <redacted> Cc: Oleksandr Kravchenko <redacted> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/iio/accel/bma180.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c@@ -376,6 +376,8 @@ static int bma180_write_raw(struct iio_d mutex_unlock(&data->mutex); return ret; case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: + if (val2) + return -EINVAL; mutex_lock(&data->mutex); ret = bma180_set_bw(data, val); mutex_unlock(&data->mutex);