diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-05-11 22:02:26 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-05-11 23:02:10 +0100 |
commit | 6164741f81fbb80d25ba3877251f4b31de3ed6a0 (patch) | |
tree | ffa86f6ffa6c484d695a0557ef786bc98811c5c9 | |
parent | 47931a4de53ccdeda061c59aa0919f152cf0dfdf (diff) | |
download | ipxe-6164741f81fbb80d25ba3877251f4b31de3ed6a0.tar.gz |
[efi] Guard against GetStatus() failing to return a NULL TX buffer
The UEFI specification requires the EFI_SIMPLE_NETWORK_PROTOCOL
GetStatus() method to set TxBuf to NULL if there are no transmit
buffers to recycle.
Some implementations (observed with Lan9118Dxe in EDK2) fill in TxBuf
only when there is a transmit buffer to recycle, which leads to large
numbers of "spurious TX completion" errors.
Work around this problem by initialising TxBuf to NULL before calling
the GetStatus() method.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/drivers/net/efi/snpnet.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/net/efi/snpnet.c b/src/drivers/net/efi/snpnet.c index 0d876b636..88474b0be 100644 --- a/src/drivers/net/efi/snpnet.c +++ b/src/drivers/net/efi/snpnet.c @@ -191,6 +191,7 @@ static void snpnet_poll_tx ( struct net_device *netdev ) { int rc; /* Get status */ + txbuf = NULL; if ( ( efirc = snp->snp->GetStatus ( snp->snp, &irq, &txbuf ) ) != 0 ) { rc = -EEFI ( efirc ); DBGC ( snp, "SNP %s could not get status: %s\n", |