mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
463d994f9c
commit
2d66393219
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
The driver binding and service binding protocol for IP6 driver.
|
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>
|
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
|
@ -564,7 +564,7 @@ Ip6DriverBindingStart (
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto ON_ERROR;
|
goto FREE_SERVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -573,7 +573,7 @@ Ip6DriverBindingStart (
|
||||||
//
|
//
|
||||||
Status = Ip6ConfigReadConfigData (IpSb->MacString, &IpSb->Ip6ConfigInstance);
|
Status = Ip6ConfigReadConfigData (IpSb->MacString, &IpSb->Ip6ConfigInstance);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto ON_ERROR;
|
goto UNINSTALL_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -588,7 +588,7 @@ Ip6DriverBindingStart (
|
||||||
DataItem->Data.Ptr
|
DataItem->Data.Ptr
|
||||||
);
|
);
|
||||||
if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
|
if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
|
||||||
goto ON_ERROR;
|
goto UNINSTALL_PROTOCOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ Ip6DriverBindingStart (
|
||||||
DataItem->Data.Ptr
|
DataItem->Data.Ptr
|
||||||
);
|
);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
goto ON_ERROR;
|
goto UNINSTALL_PROTOCOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -613,7 +613,7 @@ Ip6DriverBindingStart (
|
||||||
//
|
//
|
||||||
Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
|
Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto ON_ERROR;
|
goto UNINSTALL_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -625,7 +625,7 @@ Ip6DriverBindingStart (
|
||||||
TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
|
TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto ON_ERROR;
|
goto UNINSTALL_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -637,7 +637,7 @@ Ip6DriverBindingStart (
|
||||||
TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
|
TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto ON_ERROR;
|
goto UNINSTALL_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -647,7 +647,17 @@ Ip6DriverBindingStart (
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
ON_ERROR:
|
UNINSTALL_PROTOCOL:
|
||||||
|
gBS->UninstallMultipleProtocolInterfaces (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiIp6ServiceBindingProtocolGuid,
|
||||||
|
&IpSb->ServiceBinding,
|
||||||
|
&gEfiIp6ConfigProtocolGuid,
|
||||||
|
Ip6Cfg,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
FREE_SERVICE:
|
||||||
Ip6CleanService (IpSb);
|
Ip6CleanService (IpSb);
|
||||||
FreePool (IpSb);
|
FreePool (IpSb);
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Reference in New Issue