Skip to content

audio: init align to avoid uninitialized read in error log#10856

Open
abonislawski wants to merge 1 commit into
thesofproject:mainfrom
abonislawski:fix/align_init
Open

audio: init align to avoid uninitialized read in error log#10856
abonislawski wants to merge 1 commit into
thesofproject:mainfrom
abonislawski:fix/align_init

Conversation

@abonislawski

Copy link
Copy Markdown
Member

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.

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>
Copilot AI review requested due to automatic review settings June 9, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 align to 0 in Zephyr host params path to avoid logging an uninitialized value on error.
  • Initialize align to 0 in legacy host params path for the same failure mode.
  • Initialize align to 0 in 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants