Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: eth: gmac: fix race condition in packet reference counting
The SAM E70 GMAC ethernet driver reference a packet with net_pkt_ref() when queueing a packet, and unreference it with net_pkt_unref() in the ISR when it has been fully sent. The call to net_pkt_ref() is done just after re-enabling the interruptions, so there is however a small race condition that might cause the packet to be unreference before being referenced. This is only theoretical and has not been seen in practice. Fix that by moving the call to net_pkt_ref() just before re-enabling the interruptions. Signed-off-by: Aurelien Jarno <[email protected]>
- Loading branch information