summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network
diff options
context:
space:
mode:
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>2013-02-01 01:10:47 +0000
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>2013-02-01 01:10:47 +0000
commit469462b109d4344df8b4c5cc4a672100998b43a0 (patch)
treedf9400dc5be6e9be8b86c1ec2beb724a14ffbd73 /MdeModulePkg/Universal/Network
parenta412ad88e5737735ab54b35392b51d8a210c3b74 (diff)
downloadedk2-469462b109d4344df8b4c5cc4a672100998b43a0.zip
edk2-469462b109d4344df8b4c5cc4a672100998b43a0.tar.gz
edk2-469462b109d4344df8b4c5cc4a672100998b43a0.tar.bz2
Fix a bug in snp driver binding Start() that it may return incorrect status code.
Signed-off-by: Ari Zigler <ariz@mellanox.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14115 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network')
-rw-r--r--MdeModulePkg/Universal/Network/SnpDxe/Snp.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
index f1fea0c..177d0a9 100644
--- a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
+++ b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
@@ -1,7 +1,7 @@
/** @file
Implementation of driver entry point and driver binding protocol.
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed
and made available under the terms and conditions of the BSD License which
accompanies this distribution. The full text of the license may be found at
@@ -258,7 +258,7 @@ Done:
device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle
- @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
+ @retval EFI_DEVICE_ERROR This driver could not be started due to a device error
@retval other This driver does not support this device
**/
@@ -698,11 +698,11 @@ SimpleNetworkDriverStart (
return Status;
}
- Status = mPciIo->FreeBuffer (
- mPciIo,
- SNP_MEM_PAGES (4096),
- Snp->Cpb
- );
+ mPciIo->FreeBuffer (
+ mPciIo,
+ SNP_MEM_PAGES (4096),
+ Snp->Cpb
+ );
Error_DeleteSNP:
@@ -726,6 +726,13 @@ NiiError:
Controller
);
+ //
+ // If we got here that means we are in error state.
+ //
+ if (!EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ }
+
return Status;
}