audio: init align to avoid uninitialized read in error log#10856
Open
abonislawski wants to merge 1 commit into
Open
audio: init align to avoid uninitialized read in error log#10856abonislawski wants to merge 1 commit into
abonislawski wants to merge 1 commit into
Conversation
sof_dma_get_attribute() can return an error without writing its output parameter, so logging align on that path read an uninitialized value. Initialize align to 0 in the host/dai zephyr and legacy params paths. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents uninitialized reads in error logging when DMA attribute retrieval fails to write its output parameter, by initializing the local align variable to 0 in relevant host and DAI parameter paths.
Changes:
- Initialize
alignto0in Zephyr host params path to avoid logging an uninitialized value on error. - Initialize
alignto0in legacy host params path for the same failure mode. - Initialize
alignto0in Zephyr and legacy DAI DMA buffer/params paths to make error logs safe when attribute queries fail.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/audio/host-zephyr.c |
Initializes align to avoid uninitialized read in error log if sof_dma_get_attribute() fails. |
src/audio/host-legacy.c |
Initializes align to avoid uninitialized read in error log if legacy DMA attribute query fails. |
src/audio/dai-zephyr.c |
Initializes align to avoid uninitialized read in error log if sof_dma_get_attribute() fails. |
src/audio/dai-legacy.c |
Initializes align to avoid uninitialized read in error log if legacy DMA attribute query fails. |
wjablon1
approved these changes
Jun 9, 2026
kv2019i
approved these changes
Jun 9, 2026
lgirdwood
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
sof_dma_get_attribute() can return an error without writing its output parameter, so logging align on that path read an uninitialized value. Initialize align to 0 in the host/dai zephyr and legacy params paths.