Skip to content

SPI class destructor doesn't handle async transfers #311

Open
@multiplemonomials

Description

@multiplemonomials

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDis is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions