diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2014-07-16 19:32:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-07-20 17:39:47 +0100 |
commit | 9b2a4d35a6ceaf217be61ed8eb3c16986244f640 (patch) | |
tree | 96bccc925ede3293607947a361c6be0cdd0d1222 | |
parent | 381676d5e86596b11e22a62f196e192df6091373 (diff) | |
download | blackbird-op-linux-9b2a4d35a6ceaf217be61ed8eb3c16986244f640.tar.gz blackbird-op-linux-9b2a4d35a6ceaf217be61ed8eb3c16986244f640.zip |
iio:bma180: Missing check for frequency fractional part
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 <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
-rw-r--r-- | drivers/iio/accel/bma180.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 28388bb5d583..a077cc86421b 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -376,6 +376,8 @@ static int bma180_write_raw(struct iio_dev *indio_dev, 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); |