diff mbox

[01/10] MdeModulePkg/MnpDxe: Checked returned value of Snp->GetStatus()

Message ID 1381174801-17221-2-git-send-email-reece.pollack@linaro.org
State New
Headers show

Commit Message

Reece R. Pollack Oct. 7, 2013, 7:39 p.m. UTC
From: Olivier Martin <olivier.martin@arm.com>

... as explicitly said by the comment.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>

Change-Id: Id9fd51dd5510d6acd04fe2c323a901248c4b85c3
---
 MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
index 4c0f3dd..9cdbb43 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
@@ -79,8 +79,10 @@  MnpGetModeData (
     // Upon successful return of GetStatus(), the Snp->Mode->MediaPresent
     // will be updated to reflect any change of media status
     //
-    Snp->GetStatus (Snp, &InterruptStatus, NULL);
-    CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
+    Status = Snp->GetStatus (Snp, &InterruptStatus, NULL);
+    if (!EFI_ERROR (Status)) {
+      CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
+    }
   }
 
   if (!Instance->Configured) {