Skip to content

soundwire: intel_ace2x: release bpt_stream when close it#5706

Merged
bardliao merged 1 commit intothesofproject:topic/sof-devfrom
bardliao:release-bpt-stream
Mar 24, 2026
Merged

soundwire: intel_ace2x: release bpt_stream when close it#5706
bardliao merged 1 commit intothesofproject:topic/sof-devfrom
bardliao:release-bpt-stream

Conversation

@bardliao
Copy link
Collaborator

The BPT stream was allocated in intel_ace2x_bpt_open_stream(), we need to free it in intel_ace2x_bpt_close_stream().

Fixes: 4c1ce9f ("soundwire: intel_ace2x: add BPT send_async/wait callbacks")

The BPT stream was allocated in intel_ace2x_bpt_open_stream(), we need
to free it in intel_ace2x_bpt_close_stream().

Fixes: 4c1ce9f ("soundwire: intel_ace2x: add BPT send_async/wait callbacks")

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Copy link

Copilot AI left a comment

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 fixes a memory/resource leak in the Intel ACE2.x SoundWire driver by releasing the BPT stream runtime during stream close, matching the allocation done during BPT stream open (per the commit referenced in the Fixes tag).

Changes:

  • Release cdns->bus.bpt_stream in intel_ace2x_bpt_close_stream().
  • Clear cdns->bus.bpt_stream to NULL after releasing to avoid stale pointers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@simontrimmer simontrimmer left a comment

Choose a reason for hiding this comment

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

Looks good, I like the obvious symmetry

Tested on the PTL unit we've been discussing

@bardliao bardliao merged commit 4149c0f into thesofproject:topic/sof-dev Mar 24, 2026
16 of 20 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.

4 participants