summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/MnpDxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-18 07:01:23 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-18 07:01:23 +0000
commitc4a62a12c2890297cfcb9828b51b058fb347c01a (patch)
treef60f918368c8c96325bcfbc050c7b6189f567492 /MdeModulePkg/Universal/Network/MnpDxe
parent372787b85a2a6a6da0a7b0357f58953da26d81a8 (diff)
downloadedk2-platforms-c4a62a12c2890297cfcb9828b51b058fb347c01a.tar.xz
Sync the latest version from R8.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4400 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/MnpDxe')
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c82
1 files changed, 36 insertions, 46 deletions
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
index 814566ec56..946ace1f66 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
@@ -219,64 +219,54 @@ MnpDriverBindingStop (
("MnpDriverBindingStop: Locate MNP Service Binding Protocol failed, %r.\n",
Status)
);
- goto EXIT;
+ return EFI_DEVICE_ERROR;
}
MnpServiceData = MNP_SERVICE_DATA_FROM_THIS (ServiceBinding);
- while (!NetListIsEmpty (&MnpServiceData->ChildrenList)) {
+ if (NumberOfChildren == 0) {
//
- // Don't use NetListRemoveHead here, the remove opreration will be done
- // in ServiceBindingDestroyChild.
+ // Uninstall the MNP Service Binding Protocol.
//
- Instance = NET_LIST_HEAD (
- &MnpServiceData->ChildrenList,
- MNP_INSTANCE_DATA,
- InstEntry
- );
-
- ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
- }
+ gBS->UninstallMultipleProtocolInterfaces (
+ ControllerHandle,
+ &gEfiManagedNetworkServiceBindingProtocolGuid,
+ ServiceBinding,
+ NULL
+ );
- //
- // Uninstall the MNP Service Binding Protocol.
- //
- Status = gBS->UninstallMultipleProtocolInterfaces (
- ControllerHandle,
- &gEfiManagedNetworkServiceBindingProtocolGuid,
- ServiceBinding,
- NULL
- );
- if (EFI_ERROR (Status)) {
+ //
+ // Close the openned Snp protocol.
+ //
+ gBS->CloseProtocol (
+ ControllerHandle,
+ &gEfiSimpleNetworkProtocolGuid,
+ This->DriverBindingHandle,
+ ControllerHandle
+ );
- MNP_DEBUG_ERROR (("MnpDriverBindingStop: Uninstall MNP Service Binding Protocol failed, %r.\n"));
- goto EXIT;
- }
+ //
+ // Flush the Mnp service data.
+ //
+ MnpFlushServiceData (MnpServiceData);
- //
- // Close the openned Snp protocol.
- //
- Status = gBS->CloseProtocol (
- ControllerHandle,
- &gEfiSimpleNetworkProtocolGuid,
- This->DriverBindingHandle,
- ControllerHandle
- );
- if (EFI_ERROR (Status)) {
+ NetFreePool (MnpServiceData);
+ } else {
+ while (!NetListIsEmpty (&MnpServiceData->ChildrenList)) {
+ //
+ // Don't use NetListRemoveHead here, the remove opreration will be done
+ // in ServiceBindingDestroyChild.
+ //
+ Instance = NET_LIST_HEAD (
+ &MnpServiceData->ChildrenList,
+ MNP_INSTANCE_DATA,
+ InstEntry
+ );
- MNP_DEBUG_ERROR (("MnpDriverBindingStop: Close SNP Protocol failed, %r.\n", Status));
- goto EXIT;
+ ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
+ }
}
- //
- // Flush the Mnp service data.
- //
- MnpFlushServiceData (MnpServiceData);
-
- NetFreePool (MnpServiceData);
-
-EXIT:
-
return Status;
}