From 4b76bce48c7a03a6ae324278a3a9fdc78e1049d4 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 28355d1d37495c..f687cd0529ebd6 100644 --- a/drivers/flash/flash_handlers.c +++ b/drivers/flash/flash_handlers.c @@ -32,7 +32,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