-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flash API: flash_erase
has incorrect userspace handler
#81777
Closed
Labels
Milestone
Comments
de-nordic
added a commit
to de-nordic/zephyr
that referenced
this issue
Nov 22, 2024
As the erase callback is optional, handler should not check if it is not NULL. Fixes zephyrproject-rtos#81777 Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
de-nordic
added a commit
to de-nordic/zephyr
that referenced
this issue
Nov 22, 2024
As the erase callback is optional, handler should not check if it is not NULL. Fixes zephyrproject-rtos#81777 Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
de-nordic
added a commit
to de-nordic/zephyr
that referenced
this issue
Nov 27, 2024
As the erase callback is optional, handler should not check if it is not NULL. Fixes zephyrproject-rtos#81777 Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This was referenced Dec 20, 2024
This was
linked to
pull requests
Dec 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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: