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 class destructor doesn't handle async transfers #311

Open
multiplemonomials opened this issue Jul 22, 2024 · 0 comments
Open

SPI class destructor doesn't handle async transfers #311

multiplemonomials opened this issue Jul 22, 2024 · 0 comments
Labels
Bug Dis is broken

Comments

@multiplemonomials
Copy link
Collaborator

Noticed a minor issue with the SPI class: destroying an SPI while async transfers are in progress will almost certainly result in out-of-bounds accesses, because (a) the transaction queue will still hold on to a pointer to the SPI class, and (b) the transfer completion callback for the current transfer will call into the class which is currently being deleted.

I think that this destructor should be updated to either abort any transfers which are currently in progress for this peripheral that refer to the current SPI class (probably hard), or just block until those transfers complete (not as hard, but will need some code changes, e.g. aborting will have to send an event)

@multiplemonomials multiplemonomials added the Bug Dis is broken label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dis is broken
Projects
None yet
Development

No branches or pull requests

1 participant