]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: cdev: zero padding during conversion to gpioline_info_changed
authorGabriel Knezek <gabeknez@linux.microsoft.com>
Mon, 21 Jun 2021 22:28:59 +0000 (15:28 -0700)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 22 Jun 2021 07:54:13 +0000 (09:54 +0200)
commitf3bad1613116976fd3bf9e947448971e81205fbe
tree1b6267bdc7e0e75bdb730ed75276077e7c458941
parent5ab07e8c22308ba39c8bb4b3fb6a7d149dc62638
gpiolib: cdev: zero padding during conversion to gpioline_info_changed

When userspace requests a GPIO v1 line info changed event,
lineinfo_watch_read() populates and returns the gpioline_info_changed
structure. It contains 5 words of padding at the end which are not
initialized before being returned to userspace.

Zero the structure in gpio_v2_line_info_change_to_v1() before populating
its contents.

Fixes: 9bacc9f55993 ("gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL")
Signed-off-by: Gabriel Knezek <gabeknez@linux.microsoft.com>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib-cdev.c