From 017c142fd28134eaeafb1bf96ae9f8ffce64b688 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Sat, 14 Mar 2020 20:28:30 -0700 Subject: [PATCH] drivers: uart: Add config_get verification handler uart_config_get API was broken in USERSPACE because was lacking the verification handler. Signed-off-by: Flavio Ceolin --- drivers/serial/uart_handlers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/serial/uart_handlers.c b/drivers/serial/uart_handlers.c index 44620d4c456..6619c2d9f1b 100644 --- a/drivers/serial/uart_handlers.c +++ b/drivers/serial/uart_handlers.c @@ -41,6 +41,16 @@ static inline void z_vrfy_uart_poll_out(struct device *dev, } #include +static inline int z_vrfy_uart_config_get(struct device *dev, + struct uart_config *cfg) +{ + Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, config_get)); + Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cfg, sizeof(struct uart_config))); + + return z_impl_uart_config_get(dev, cfg); +} +#include + #ifdef CONFIG_UART_ASYNC_API /* callback_set() excluded as we don't allow ISR callback installation from * user mode