From: Michael Brown Date: Wed, 11 May 2016 21:50:09 +0000 (+0100) Subject: EmbeddedPkg/Lan9118Dxe: Do not return uninitialised TxBuff X-Git-Tag: edk2-stable201903~7076 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e117c894fdf1896fea5d37057832fed58d48b6ee EmbeddedPkg/Lan9118Dxe: Do not return uninitialised TxBuff Conform to the specification for GetStatus(), which states that "if there are no transmit buffers to recycle and TxBuf is not NULL, *TxBuf will be set to NULL". Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Brown Reviewed-by: Ard Biesheuvel --- diff --git a/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c b/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c index 8af23df394..aabaf604f6 100644 --- a/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c +++ b/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c @@ -1055,6 +1055,8 @@ SnpGetStatus ( LanDriver->Stats.TxTotalFrames += 1; *TxBuff = LanDriver->TxRing[PacketTag % LAN9118_TX_RING_NUM_ENTRIES]; } + } else if (TxBuff != NULL) { + *TxBuff = NULL; } // Check for a TX Error interrupt