Skip to content

Conversation

@lyakh
Copy link
Collaborator

@lyakh lyakh commented Jul 24, 2025

The 4 buffer operation sets: comp_buffer_source_ops, comp_buffer_sink_ops, ring_buffer_source_ops and
ring_buffer_sink_ops are pointed to by every buffer. Yet when initialising each of those buffers attempts are made to overwrite those global objects with the same pointers. So in practive when the first buffer is registered, it overwrites those object members, and then all further buffers inherit those changes. This works because those values are always the same, still this isn't a good practice. Assign those members statically and make objects constant instead.

The 4 buffer operation sets: comp_buffer_source_ops,
comp_buffer_sink_ops, ring_buffer_source_ops and
ring_buffer_sink_ops are pointed to by every buffer. Yet when
initialising each of those buffers attempts are made to overwrite
those global objects with the same pointers. So in practive when the
first buffer is registered, it overwrites those object members, and
then all further buffers inherit those changes. This works because
those values are always the same, still this isn't a good practice.
Assign those members statically and make objects constant instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@kv2019i kv2019i merged commit 3e4736f into thesofproject:main Jul 30, 2025
39 of 45 checks passed
@lyakh lyakh deleted the buf branch July 30, 2025 07:11
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