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

spi_context_Lock leakage when exception occurs #72782

Open
foxriver1025 opened this issue May 15, 2024 · 3 comments · May be fixed by #73765
Open

spi_context_Lock leakage when exception occurs #72782

foxriver1025 opened this issue May 15, 2024 · 3 comments · May be fixed by #73765
Assignees
Labels
area: SPI SPI bus bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@foxriver1025
Copy link

Here, spi_context_release is not called before the return error, causing the lock to be leaked.

@tbursztyka
Copy link
Collaborator

Easy fix, just replace that line into a goto out, and put the out: label at line 658. Can you send a patch?

@henrikbrixandersen
Copy link
Member

Please use our bug template when reporting bugs. You need to edit this issue to include the information requested in https://github.com/zephyrproject-rtos/zephyr/blob/main/.github/ISSUE_TEMPLATE/001_bug_report.md

@henrikbrixandersen henrikbrixandersen added bug The issue is a bug, or the PR is fixing a bug area: SPI SPI bus labels May 15, 2024
@nashif nashif added the priority: medium Medium impact/importance bug label May 21, 2024
@nashif
Copy link
Member

nashif commented Jun 4, 2024

@tbursztyka can you send a patch please?

tbursztyka added a commit to tbursztyka/zephyr that referenced this issue Jun 5, 2024
SPI context has to be released even in case of error.

Fixes: zephyrproject-rtos#72782

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@proton.me>
tbursztyka added a commit to tbursztyka/zephyr that referenced this issue Jun 5, 2024
SPI context has to be released even in case of error.

Fixes: zephyrproject-rtos#72782

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@proton.me>
@tbursztyka tbursztyka linked a pull request Jun 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SPI SPI bus bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants