diff options
author | Olivier Martin <olivier.martin@arm.com> | 2014-10-27 10:35:57 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2014-10-27 10:35:57 +0000 |
commit | a537c71726627da40d786b1644d68cc7c3654d31 (patch) | |
tree | 79a248d4b7e7196dace0a7dd7cce48d5f9b227d3 /EmbeddedPkg | |
parent | c9263c7dd26a17c1f1990f2554e8ec0f469e0080 (diff) | |
download | edk2-platforms-a537c71726627da40d786b1644d68cc7c3654d31.tar.xz |
EmbeddedPkg/Lan9118Dxe: Fixed dereferencing optional NULL pointer
TxBuff argument is optional in SNP.GetStatus(). This argument can be NULL.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16236 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c b/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c index b269c60f39..ec0175408a 100644 --- a/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c +++ b/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c @@ -918,7 +918,7 @@ SnpGetStatus ( TxStatus = MmioRead32 (LAN9118_TX_STATUS);
PacketTag = TxStatus >> 16;
TxStatus = TxStatus & 0xFFFF;
- if ((TxStatus & TXSTATUS_ES) && TxStatus != (TXSTATUS_ES | TXSTATUS_NO_CA)) {
+ if ((TxStatus & TXSTATUS_ES) && (TxStatus != (TXSTATUS_ES | TXSTATUS_NO_CA))) {
DEBUG ((EFI_D_ERROR, "LAN9118: There was an error transmitting. TxStatus=0x%08x:", TxStatus));
if (TxStatus & TXSTATUS_NO_CA) {
DEBUG ((EFI_D_ERROR, "- No carrier\n"));
@@ -939,7 +939,7 @@ SnpGetStatus ( DEBUG ((EFI_D_ERROR, "- Lost carrier during Tx\n"));
}
return EFI_DEVICE_ERROR;
- } else {
+ } else if (TxBuff != NULL) {
LanDriver->Stats.TxTotalFrames += 1;
*TxBuff = LanDriver->TxRing[PacketTag % LAN9118_TX_RING_NUM_ENTRIES];
}
|