diff options
author | Daniel Baluta <daniel.baluta@intel.com> | 2014-10-10 10:53:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-11-05 13:33:46 -0500 |
commit | 25afffe16d07909197f99163ca7cd1f80fb5cbdd (patch) | |
tree | a3f439437c80ec340ad36670dcad9c1e4b0a1f59 | |
parent | 03045bcf312961cc75b2719aad6b4d69907884db (diff) |
io: accel: kxcjk-1013: Fix iio_event_spec direction
Because IIO_EV_DIR_* are not bitmasks but enums,
IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING is not equal
with IIO_EV_DIR_EITHER.
This could lead to potential misformatted sysfs attributes
like:
* in_accel_x_thresh_(null)_en
* in_accel_x_thresh_(null)_period
* in_accel_x_thresh_(null)_value
or even memory corruption.
Fixes: b4b491c083 (iio: accel: kxcjk-1013: Support threshold)
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/accel/kxcjk-1013.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 98909a9e284e..a23e58c4ed99 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c | |||
@@ -894,7 +894,7 @@ static const struct attribute_group kxcjk1013_attrs_group = { | |||
894 | 894 | ||
895 | static const struct iio_event_spec kxcjk1013_event = { | 895 | static const struct iio_event_spec kxcjk1013_event = { |
896 | .type = IIO_EV_TYPE_THRESH, | 896 | .type = IIO_EV_TYPE_THRESH, |
897 | .dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING, | 897 | .dir = IIO_EV_DIR_EITHER, |
898 | .mask_separate = BIT(IIO_EV_INFO_VALUE) | | 898 | .mask_separate = BIT(IIO_EV_INFO_VALUE) | |
899 | BIT(IIO_EV_INFO_ENABLE) | | 899 | BIT(IIO_EV_INFO_ENABLE) | |
900 | BIT(IIO_EV_INFO_PERIOD) | 900 | BIT(IIO_EV_INFO_PERIOD) |