]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: improve the robustness of watch/unwatch ioctl()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 15 Apr 2020 08:23:59 +0000 (10:23 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 23 Apr 2020 15:55:27 +0000 (17:55 +0200)
commitd6ac761cc208ec75da9f93612da9dabf6896682f
treef57ab3f0ec6a8e32977145326d10243003cdb202
parent88ab240a62aaf588bad2dda9cbda6b2c865ca90b
gpiolib: improve the robustness of watch/unwatch ioctl()

This makes the new ioctl() a bit more robust - we now check if a line
is already being watched and return -EBUSY if the user-space tries to
start watching it again. Same for unwatch - return -EBUSY if user-space
tries to unwatch a line that's not being watched.

Fixes: 0df052ed08fa ("gpiolib: add new ioctl() for monitoring changes in line info")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c