Skip to content
Commit 33dae59a authored by Aurelien Jarno's avatar Aurelien Jarno Committed by Jukka Rissanen
Browse files

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: default avatarAurelien Jarno <aurelien@aurel32.net>
parent d678f309
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment