Skip to content

Commit 25afffe

Browse files
Daniel Balutajic23
authored andcommitted
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: b4b491c (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>
1 parent 03045bc commit 25afffe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/iio/accel/kxcjk-1013.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ static const struct attribute_group kxcjk1013_attrs_group = {
894894

895895
static const struct iio_event_spec kxcjk1013_event = {
896896
.type = IIO_EV_TYPE_THRESH,
897-
.dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING,
897+
.dir = IIO_EV_DIR_EITHER,
898898
.mask_separate = BIT(IIO_EV_INFO_VALUE) |
899899
BIT(IIO_EV_INFO_ENABLE) |
900900
BIT(IIO_EV_INFO_PERIOD)

0 commit comments

Comments
 (0)