Flash API: flash_erase
has incorrect userspace handler
#81777
Labels
Milestone
flash_erase
has incorrect userspace handler
#81777
Describe the bug
Drivers have option to not implement erase, in which case pointer to erase callback may be left NULL:
zephyr/include/zephyr/drivers/flash.h
Lines 309 to 312 in c14b022
But handler for the erase has been left as it is always expected:
zephyr/drivers/flash/flash_handlers.c
Line 34 in c14b022
Expected behavior
Proper check should be done using
K_SYSCALL_OBJ
, to only verify the object, ignoring whether erase callback is assigned or not.Impact
Currently only on out-of-tree drivers that do not implement erase.
Environment (please complete the following information):
Additional context
Verification Return Value Policies
K_SYSCALL_OBJ
K_SYSCALL_DRIVER_OP
The text was updated successfully, but these errors were encountered: