diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2014-07-16 19:32:00 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-07 16:53:52 -0700 |
commit | e66a33cf4c92ec182a240d64789abeb968871de4 (patch) | |
tree | 94585a9bae74fa67affb3589cc6efc3cf52bd7fc | |
parent | 9e3b94397b34a287bc1c9da207528e975c59a12d (diff) | |
download | lwn-e66a33cf4c92ec182a240d64789abeb968871de4.tar.gz lwn-e66a33cf4c92ec182a240d64789abeb968871de4.zip |
iio:bma180: Missing check for frequency fractional part
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 <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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); |