Skip to content

Commit cb12473

Browse files
author
Emil Popov
committed
Allows release of the network buffer if gmac_dev_write() fails and the ero-copy driver is being used.
Thanks @htibosch
1 parent a8d2063 commit cb12473

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/portable/NetworkInterface/DriverSAM/NetworkInterface.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,12 @@ static BaseType_t prvSAM_NetworkInterfaceOutput( NetworkInterface_t * pxInterfac
661661

662662
#if ( ipconfigZERO_COPY_TX_DRIVER != 0 )
663663
{
664-
/* Confirm that the pxDescriptor may be kept by the driver. */
665-
bReleaseAfterSend = pdFALSE;
664+
if( ulResult == GMAC_OK )
665+
{
666+
/* The message was send in a zero-copy way.
667+
* It will be released after a succeful transmission. */
668+
bReleaseAfterSend = pdFALSE;
669+
}
666670
}
667671
#endif /* ipconfigZERO_COPY_TX_DRIVER */
668672
/* Not interested in a call-back after TX. */

0 commit comments

Comments
 (0)