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
This commit is contained in:
Peter Meerwald 2014-07-16 19:32:00 +01:00 committed by Jonathan Cameron
parent 381676d5e8
commit 9b2a4d35a6
1 changed files with 2 additions and 0 deletions

View File

@ -376,6 +376,8 @@ static int bma180_write_raw(struct iio_dev *indio_dev,
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);
return ret; return ret;
case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
if (val2)
return -EINVAL;
mutex_lock(&data->mutex); mutex_lock(&data->mutex);
ret = bma180_set_bw(data, val); ret = bma180_set_bw(data, val);
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);