gpiolib: fix bitmap operations related to line event watching
commit1931479788c5e3c0396a0bde3606e517c64b9f95
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 26 Feb 2020 13:53:23 +0000 (26 14:53 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 2 Mar 2020 07:52:55 +0000 (2 08:52 +0100)
tree6ae88024c465be5f25baa035323808269c3f196c
parent48543bd8e92880b1ca81b15cf392103dc82cd3e0
gpiolib: fix bitmap operations related to line event watching

When operating on the bits of watched_lines bitmap, we're using
desc_to_gpio() which returns the GPIO number from the global numberspace.
This leads to all sorts of memory corruptions and invalid behavior. We
should switch to using gpio_chip_hwgpio() instead.

Fixes: 51c1064e82e7 ("gpiolib: add new ioctl() for monitoring changes in line info")
Reported-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Kent Gibson <warthog618@gmail.com>
drivers/gpio/gpiolib.c