gpiolib: Fix line event handling in syscall compatible mode
The introduced line event handling ABI in the commit 61f922db ("gpio: userspace ABI for reading GPIO line events") missed the fact that 64-bit kernel may serve for 32-bit applications. In such case the very first check in the lineevent_read() will fail due to alignment differences. To workaround this introduce lineevent_get_size() helper which returns actual size of the structure in user space. Fixes: 61f922db ("gpio: userspace ABI for reading GPIO line events") Suggested-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NArnd Bergmann <arnd@arndb.de> Tested-by: NKent Gibson <warthog618@gmail.com> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
Showing
想要评论请 注册 或 登录