]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: fix filtering out unwanted events
authorBartosz Golaszewski <brgl@bgdev.pl>
Fri, 23 Jun 2017 11:45:16 +0000 (13:45 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 29 Jun 2017 09:33:46 +0000 (11:33 +0200)
commite8590c8cd86ada26c4ef8f7d93df0e8bcd608b6e
tree0894a0efdc66032a12b792e2e40d0506732cde83
parent392d94e7e48cbd11cc2b3ae100b44fa06d514340
gpiolib: fix filtering out unwanted events

GPIOEVENT_REQUEST_BOTH_EDGES is not a single flag, but a binary OR of
GPIOEVENT_REQUEST_RISING_EDGE and GPIOEVENT_REQUEST_FALLING_EDGE.

The expression 'le->eflags & GPIOEVENT_REQUEST_BOTH_EDGES' we'll get
evaluated to true even if only one event type was requested.

Fix it by checking both RISING & FALLING flags explicitly.

Cc: stable@vger.kernel.org
Fixes: f79c945d61f1 ("gpio: userspace ABI for reading GPIO line events")
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c