Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: audio: ascs: Fix invalid memset of QoS parameters #60107

Merged

Conversation

MariuszSkamra
Copy link
Collaborator

This fixes invalid memset of QoS parameters that may happen if Config Qos operation is requested on ASE in QoS Configured state. In such case if the requested parameters have been rejected, the ASE QoS parameters shall remain unchanged (were memset instead). Otherwise, the stack shall send QoS Configured state notification with cleaned up parameters (all zero's) which was not done.

This fixes invalid memset of QoS parameters that may happen if Config
Qos operation is requested on ASE in QoS Configured state. In such case
if the requested parameters have been rejected, the ASE QoS parameters
shall remain unchanged (were memset instead). Otherwise, the stack shall
send QoS Configured state notification with cleaned up parameters (all
zero's) which was not done.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Comment on lines +1836 to +1842
cqos.interval = sys_get_le24(qos->interval);
cqos.framing = qos->framing;
cqos.phy = qos->phy;
cqos.sdu = sys_le16_to_cpu(qos->sdu);
cqos.rtn = qos->rtn;
cqos.latency = sys_le16_to_cpu(qos->latency);
cqos.pd = sys_get_le24(qos->pd);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could consider pulling these values directly from buf instead of doing qos = net_buf_simple_pull_mem(buf, sizeof(*qos)); followed by these assignments.

@carlescufi carlescufi merged commit 1ca75e3 into zephyrproject-rtos:main Jul 13, 2023
22 checks passed
@MariuszSkamra MariuszSkamra deleted the ascs_qos_congig_fix branch July 14, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants