cpu/nrf52 radio: Populate info #17592
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
According to ieee802154_radio_confirm_transmit docs, the parameter of
confirm_op for IEEE802154_HAL_OP_TRANSMIT is to be populated as an out
parameter -- but this implementation unconditionally left info
unpopulated. Thus, when run with LLVM, _fsm_state_tx_process_tx_done
looked into an uninitialized info and thus crashed into failing
assertions.
Note that the init was initialized NULL and later that init is checked for being NULL; now there's an actual non-NULL (or maybe non-NULL as the caller may well pass in NULL) writing access.
I checked the wrappers for the other _confirm_op operations, and they either pass in NULL as the argument, or pass in a boolean clear parameter that does get set, so it seems justified to only set info in this particular branch. (One might consider moving the info population step up right away, but it kind of makes sense there if one anticipates there might come to be more ops that use an info in the same way, and as things are the compiler should be free to make that enhancement on its own).
Testing procedure
TOOLCHAIN=llvm
Issues/PRs references
Closes: #17591