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: Mesh: Virtual address memory leak #28279

Merged
merged 1 commit into from
Sep 12, 2020

Conversation

trond-snekvik
Copy link
Contributor

@trond-snekvik trond-snekvik commented Sep 10, 2020

Fixes a memory leak when a virtual address subscription is added for a
model that either has this VA already, or the model has no more space
for subscription addresses.

Split off from #28062 to go into 2.4.

Signed-off-by: Trond Einar Snekvik Trond.Einar.Snekvik@nordicsemi.no

@trond-snekvik trond-snekvik added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth area: Bluetooth Mesh labels Sep 10, 2020
@trond-snekvik trond-snekvik added this to the v2.4.0 milestone Sep 10, 2020
@LingaoM
Copy link
Collaborator

LingaoM commented Sep 10, 2020

Looks indeed is bug, but I think the same operation should be done in these places.

1 mod_pub_va_set
2 mod_sub_va_overwrite

More, if model publish first set with label uuid, and again with mod_pub_set, memory leak also will be appear. So, should check whether each place in mod->group[] is a virtual address.

Copy link
Collaborator

@LingaoM LingaoM left a comment

Choose a reason for hiding this comment

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

See comments in above.

Copy link
Collaborator

@LingaoM LingaoM left a comment

Choose a reason for hiding this comment

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

LGTM

Fixes a memory leak when a virtual address subscription is added for a
model that either has this VA already, or the model has no more space
for subscription addresses.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
@jhedberg jhedberg merged commit 61819f2 into zephyrproject-rtos:master Sep 12, 2020
@trond-snekvik trond-snekvik deleted the label_memleak branch July 23, 2021 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Mesh area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants