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

cf_set() returns 0 when no cfg is available #25447

Closed
TTJO opened this issue May 19, 2020 · 2 comments · Fixed by #25543
Closed

cf_set() returns 0 when no cfg is available #25447

TTJO opened this issue May 19, 2020 · 2 comments · Fixed by #25543
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@TTJO
Copy link
Collaborator

TTJO commented May 19, 2020

In gatt.c @ cf_set(), the function returns with success (0) when no cfg is available.

cfg = find_cf_cfg_by_addr(id, &addr); if (!cfg) { cfg = find_cf_cfg(NULL); if (!cfg) { BT_ERR("Unable to restore CF: no cfg left"); return 0; } }

The function should probably return
return -ENOMEM;
when no cfg is available.

The impact on my progress is currently not assessed. Just found this bug as part of another bug-hunt.

@TTJO TTJO added the bug The issue is a bug, or the PR is fixing a bug label May 19, 2020
@carlescufi carlescufi added area: Bluetooth priority: low Low impact/importance bug labels May 19, 2020
@carlescufi
Copy link
Member

@TTJO would you mind sending a PR? This is a trivial change and a good first Pull Request.

@TTJO
Copy link
Collaborator Author

TTJO commented May 20, 2020

Yes... I will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants