diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-12-18 07:01:23 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-12-18 07:01:23 +0000 |
commit | c4a62a12c2890297cfcb9828b51b058fb347c01a (patch) | |
tree | f60f918368c8c96325bcfbc050c7b6189f567492 /MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c | |
parent | 372787b85a2a6a6da0a7b0357f58953da26d81a8 (diff) | |
download | edk2-c4a62a12c2890297cfcb9828b51b058fb347c01a.zip edk2-c4a62a12c2890297cfcb9828b51b058fb347c01a.tar.gz edk2-c4a62a12c2890297cfcb9828b51b058fb347c01a.tar.bz2 |
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/Mtftp4Dxe/Mtftp4Driver.c')
-rw-r--r-- | MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c index 1186249..f6f431d 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c @@ -348,7 +348,7 @@ Mtftp4DriverBindingStop ( NicHandle = NetLibGetNicHandle (Controller, &gEfiUdp4ProtocolGuid);
if (NicHandle == NULL) {
- return EFI_SUCCESS;
+ return EFI_DEVICE_ERROR;
}
Status = gBS->OpenProtocol (
@@ -370,37 +370,32 @@ Mtftp4DriverBindingStop ( return EFI_SUCCESS;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
- MtftpSb->InDestory = TRUE;
+ OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
- while (!NetListIsEmpty (&MtftpSb->Children)) {
- Instance = NET_LIST_HEAD (&MtftpSb->Children, MTFTP4_PROTOCOL, Link);
- Mtftp4ServiceBindingDestroyChild (ServiceBinding, Instance->Handle);
- }
+ if (NumberOfChildren == 0) {
- if (MtftpSb->ChildrenNum != 0) {
- Status = EFI_DEVICE_ERROR;
- goto ON_ERROR;
- }
+ MtftpSb->InDestory = TRUE;
- Status = gBS->UninstallProtocolInterface (
- NicHandle,
- &gEfiMtftp4ServiceBindingProtocolGuid,
- ServiceBinding
- );
+ gBS->UninstallProtocolInterface (
+ NicHandle,
+ &gEfiMtftp4ServiceBindingProtocolGuid,
+ ServiceBinding
+ );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
+ Mtftp4CleanService (MtftpSb);
- Mtftp4CleanService (MtftpSb);
- NetFreePool (MtftpSb);
+ NetFreePool (MtftpSb);
+ } else {
- NET_RESTORE_TPL (OldTpl);
- return EFI_SUCCESS;
+ while (!NetListIsEmpty (&MtftpSb->Children)) {
+ Instance = NET_LIST_HEAD (&MtftpSb->Children, MTFTP4_PROTOCOL, Link);
+ Mtftp4ServiceBindingDestroyChild (ServiceBinding, Instance->Handle);
+ }
-ON_ERROR:
- MtftpSb->InDestory = FALSE;
+ if (MtftpSb->ChildrenNum != 0) {
+ Status = EFI_DEVICE_ERROR;
+ }
+ }
NET_RESTORE_TPL (OldTpl);
return Status;
|