]> git.baikalelectronics.ru Git - kernel.git/commit
io: accel: kxcjk-1013: Fix iio_event_spec direction
authorDaniel Baluta <daniel.baluta@intel.com>
Fri, 10 Oct 2014 14:53:00 +0000 (15:53 +0100)
committerJonathan Cameron <jic23@kernel.org>
Wed, 5 Nov 2014 18:33:46 +0000 (18:33 +0000)
commit1cb93e5efa38322f77b375baf70cc13124418535
treea3f439437c80ec340ad36670dcad9c1e4b0a1f59
parent9c5980a27b490518fc305e4855d3535db2d3e3eb
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: aacba4ea5c (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>
drivers/iio/accel/kxcjk-1013.c