summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/Ip6Dxe/Ip6Driver.c
diff options
context:
space:
mode:
authorJiaxin Wu <Jiaxin.wu@intel.com>2019-01-25 08:53:48 +0800
committerJiaxin Wu <Jiaxin.wu@intel.com>2019-02-12 08:25:37 +0800
commit2d6639321986653a2a604dc7fb02b76bb21c8373 (patch)
treea8419476065005ed29055f36d575e6401d06d4ec /NetworkPkg/Ip6Dxe/Ip6Driver.c
parent463d994f9c43bcfc522ed5153bfbff654fba14c5 (diff)
downloadedk2-2d6639321986653a2a604dc7fb02b76bb21c8373.tar.gz
edk2-2d6639321986653a2a604dc7fb02b76bb21c8373.tar.bz2
edk2-2d6639321986653a2a604dc7fb02b76bb21c8373.zip
NetworkPkg/Ip6Dxe: Uninstall protocols when error happen in Driver Binding Start.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1447 This patch is to uninstall Ip6ServiceBindingProtocol and Ip6ConfigProtocol when error happen in Driver Binding Start. Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Signed-off-by: Michael Turner <Michael.Turner@microsoft.com> Reviewed-By: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg/Ip6Dxe/Ip6Driver.c')
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Driver.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index 0bda1687f0..4c607125a6 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for IP6 driver.
- Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
@@ -564,7 +564,7 @@ Ip6DriverBindingStart (
NULL
);
if (EFI_ERROR (Status)) {
- goto ON_ERROR;
+ goto FREE_SERVICE;
}
//
@@ -573,7 +573,7 @@ Ip6DriverBindingStart (
//
Status = Ip6ConfigReadConfigData (IpSb->MacString, &IpSb->Ip6ConfigInstance);
if (EFI_ERROR (Status)) {
- goto ON_ERROR;
+ goto UNINSTALL_PROTOCOL;
}
//
@@ -588,7 +588,7 @@ Ip6DriverBindingStart (
DataItem->Data.Ptr
);
if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
- goto ON_ERROR;
+ goto UNINSTALL_PROTOCOL;
}
}
@@ -604,7 +604,7 @@ Ip6DriverBindingStart (
DataItem->Data.Ptr
);
if (EFI_ERROR(Status)) {
- goto ON_ERROR;
+ goto UNINSTALL_PROTOCOL;
}
}
@@ -613,7 +613,7 @@ Ip6DriverBindingStart (
//
Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
if (EFI_ERROR (Status)) {
- goto ON_ERROR;
+ goto UNINSTALL_PROTOCOL;
}
//
@@ -625,7 +625,7 @@ Ip6DriverBindingStart (
TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
);
if (EFI_ERROR (Status)) {
- goto ON_ERROR;
+ goto UNINSTALL_PROTOCOL;
}
//
@@ -637,7 +637,7 @@ Ip6DriverBindingStart (
TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
);
if (EFI_ERROR (Status)) {
- goto ON_ERROR;
+ goto UNINSTALL_PROTOCOL;
}
//
@@ -647,7 +647,17 @@ Ip6DriverBindingStart (
return EFI_SUCCESS;
-ON_ERROR:
+UNINSTALL_PROTOCOL:
+ gBS->UninstallMultipleProtocolInterfaces (
+ ControllerHandle,
+ &gEfiIp6ServiceBindingProtocolGuid,
+ &IpSb->ServiceBinding,
+ &gEfiIp6ConfigProtocolGuid,
+ Ip6Cfg,
+ NULL
+ );
+
+FREE_SERVICE:
Ip6CleanService (IpSb);
FreePool (IpSb);
return Status;