Skip to content

audio: component: don't use uninitialized base config - #11280

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/audio/component/fix/uninitialized_use
Oct 9, 2026
Merged

kv2019i merged 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/audio/component/fix/uninitialized_use

Conversation

@tmleman

@tmleman tmleman commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

comp_update_ibs_obs_cpc() logged the comp_get_attribute() failure and set neutral values, but then fell through and immediately overwrote them from the uninitialized dev_cfg stack structure, publishing garbage ll_chunk_size, obs, ibs and cpc values to the component.

Return right after setting the neutral values so dev_cfg is only read when comp_get_attribute() succeeded.

Found by clang-analyzer-core.uninitialized.Assign.

Assisted-by: Copilot:claude-opus-5 clang-tidy

Copilot AI balanced review requested due to automatic review settings October 7, 2026 17:11

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.

🟢 Approval recommended

The focused control-flow fix correctly eliminates the reported uninitialized read.

0 open findings

What changed in this PR

Prevents publishing uninitialized IPC4 base configuration values when attribute retrieval fails.

Changes:

  • Return immediately after assigning neutral component metrics on failure.
File Description
src/​audio/​component.c Prevents reading dev_cfg after failed initialization.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@intel-sofci

Copy link
Copy Markdown

PR 11280: test results

Run date: 2026-10-07 17:38 UTC

Tested commit: 7e6c9d26e3b5a8f295dec7f0551b0d9ce227a863

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

comp_update_ibs_obs_cpc() logged the comp_get_attribute() failure and set
neutral values, but then fell through and immediately overwrote them from
the uninitialized dev_cfg stack structure, publishing garbage ll_chunk_size,
obs, ibs and cpc values to the component.

Return right after setting the neutral values so dev_cfg is only read when
comp_get_attribute() succeeded.

Found by clang-analyzer-core.uninitialized.Assign.

Assisted-by: Copilot:claude-opus-5 clang-tidy
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
@kv2019i
kv2019i merged commit 3b89fdb into thesofproject:main Oct 9, 2026
64 of 66 checks passed
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