]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Free transmit ring entry before calling netdev_tx_complete()
authorMichael Brown <mcb30@ipxe.org>
Thu, 16 Oct 2014 13:09:27 +0000 (14:09 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 16 Oct 2014 13:12:42 +0000 (14:12 +0100)
The snpnet driver uses netdev_tx_defer() and so must ensure that space
in the (single-entry) transmit descriptor ring is freed up before
calling netdev_tx_complete().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/efi/snpnet.c

index e54b529940c6cd53d7ed9be2f460d85fb268330d..2c3b552e239b93de7f2bc688744ed21c71f1d654 100644 (file)
@@ -185,6 +185,7 @@ static int snpnet_transmit ( struct net_device *netdev,
  */
 static void snpnet_poll_tx ( struct net_device *netdev ) {
        struct snp_nic *snp = netdev->priv;
+       struct io_buffer *iobuf;
        UINT32 irq;
        VOID *txbuf;
        EFI_STATUS efirc;
@@ -212,8 +213,9 @@ static void snpnet_poll_tx ( struct net_device *netdev ) {
        }
 
        /* Complete transmission */
-       netdev_tx_complete ( netdev, snp->txbuf );
+       iobuf = snp->txbuf;
        snp->txbuf = NULL;
+       netdev_tx_complete ( netdev, iobuf );
 }
 
 /**