From 4b261bfe03b739937605263c1053578394cdb80f Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Fri, 22 Nov 2024 15:23:16 +0000 Subject: [PATCH] drivers/flash: Correct flash_erase userspace handler As the erase callback is optional, handler should not check if it is not NULL. Fixes #81777 Signed-off-by: Dominik Ermel --- drivers/flash/flash_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/flash/flash_handlers.c b/drivers/flash/flash_handlers.c index b560ea8ae4baaea..f8cdaaf8f233ac2 100644 --- a/drivers/flash/flash_handlers.c +++ b/drivers/flash/flash_handlers.c @@ -31,7 +31,7 @@ static inline int z_vrfy_flash_write(const struct device *dev, off_t offset, static inline int z_vrfy_flash_erase(const struct device *dev, off_t offset, size_t size) { - K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, erase)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_FLASH)); return z_impl_flash_erase((const struct device *)dev, offset, size); } #include